Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getFocusedBuilding() #219

Closed
shawnhwei opened this issue Sep 28, 2014 · 8 comments
Closed

getFocusedBuilding() #219

shawnhwei opened this issue Sep 28, 2014 · 8 comments

Comments

@shawnhwei
Copy link
Contributor

It would be great to have access to this since indoor functionality isn't available on the javascript api yet.

@wf9a5m75
Copy link
Member

wf9a5m75 commented Oct 1, 2014

It's too large task currently. I accept your feature request, but let me pending for a while.

@shawnhwei
Copy link
Contributor Author

I don't really know how to use git and pull requests so here's some quick code I wrote to implement it.

import com.google.android.gms.maps.model.IndoorBuilding;
import com.google.android.gms.maps.model.IndoorLevel;
  private void getFocusedBuilding(final JSONArray args, final CallbackContext callbackContext) throws JSONException {
    IndoorBuilding focusedBuilding = map.getFocusedBuilding();
    JSONObject result = new JSONObject();
    if (focusedBuilding != null) {
        JSONArray levels = new JSONArray();
        for(IndoorLevel level : focusedBuilding.getLevels()){
            JSONObject levelInfo = new JSONObject();
            levelInfo.put("name",level.getName());
            levelInfo.put("shortName",level.getShortName());
            levels.put(levelInfo);
        }
        result.put("activeLevelIndex",focusedBuilding.getActiveLevelIndex());
        result.put("defaultLevelIndex",focusedBuilding.getDefaultLevelIndex());
        result.put("levels",levels);
        result.put("underground",focusedBuilding.isUnderground());
        callbackContext.success(result);
    } else {
        callbackContext.success(result);
    }
  }
App.prototype.getFocusedBuilding = function(callback) {
  var self = this;
  cordova.exec(callback, this.errorHandler, PLUGIN_NAME, 'getFocusedBuilding', []);
};

@wf9a5m75
Copy link
Member

Thank you for your code, but I don't implement without iOS code.
Since I've been busy recently, I've stopped the regular development.
But I will refer your code in the feature when I implement.

@shawnhwei
Copy link
Contributor Author

Fair enough. At least it's here if anyone else wants to edit it in themselves. I'll write the iOS code in the future as well if you don't have the chance since I'll eventually need it too.

@wf9a5m75
Copy link
Member

Sorry for inconvenience.
As you may know, there is a piles of issues.
And my real job is also busy.
If you write the code for iOS, and send a pull request, I will welcome to merge your code.

In order to send a pull request, folk this repository at once, then add the code on your repository.
Then send a pull request.

https://help.github.com/articles/using-pull-requests/

@shawnhwei
Copy link
Contributor Author

No worries! I'll do a pull request in the near future.

@wf9a5m75
Copy link
Member

Thank you.
And when you send a pull request, please make a issue_219 branch, then send your pull request on the issue_219 branch.
I don't merge a pull request into the master branch directly, and making the issue_219, I'm very useful to test your code.
Thank you for your help :)

@wf9a5m75 wf9a5m75 modified the milestone: feature request Dec 4, 2014
wf9a5m75 added a commit that referenced this issue Mar 20, 2015
…mented #219 by it.

Thank you for sending the grateful pull request, @meetshawn.
You save my time 👍
@wf9a5m75
Copy link
Member

map. getFocusedBuilding() has implemented in the test branch. (#442)

@wf9a5m75 wf9a5m75 modified the milestones: v1.2.5, feature request Mar 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants