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

Question: Accessing the map context from other components #56

Closed
EstesE opened this issue Jun 2, 2016 · 1 comment
Closed

Question: Accessing the map context from other components #56

EstesE opened this issue Jun 2, 2016 · 1 comment

Comments

@EstesE
Copy link
Contributor

EstesE commented Jun 2, 2016

I need to access the google map object from another component so I can set zoom level and bounds when a user selects a marker from my dropdown component. How can I access the map from another component?

application template:
{{my-map model=items customOptions=customOptions}}

my-map component template:

<div id="floating-panel">
    {{!-- side panel to display information about the marker --}}
    {{side-panel}}
</div>

{{#g-map id="map" options=customOptions class="embed-responsive embed-responsive-4by3"  markersFitMode='live' as |context|}}

    {{#each model as |item index|}}{{item.address.geo.lng}}
        {{#g-map-marker context lat=item.address.geo.lat lng=item.address.geo.lng onClick=(action "handleClick" item context) as |markerContext|}}
        {{/g-map-marker}}
    {{/each}}

{{/g-map}}

<div class="mapMarkerSelector">
    {{!-- dropdown to select markers --}}
    {{marker-selector model=model }}
</div>
@EstesE EstesE changed the title Accessing the map context from other components Question: Accessing the map context from other components Jun 2, 2016
@EstesE
Copy link
Contributor Author

EstesE commented Jun 3, 2016

I ended up using an eventBus. I think it will do what I require.

@EstesE EstesE closed this as completed Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant