-
Notifications
You must be signed in to change notification settings - Fork 35
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
Popup state #77
Comments
You're suggesting having a link-to inside a popup? Or clicking a popup would trigger a transition to a different route? |
Clicking a popup would trigger a transition to a different route. And then the reverse: if the app is loaded with the route, the popup is open. |
The reasoning would be to change the model through the router and make the marker react accordingly to the model. Example:
|
What if popups were componentized as compositional components: {{#ember-leaflet}}
{{tile-layer tileUrl="//a.tiles.mapbox.com/v3/examples.map-zr0njcqy/{z}/{x}/{y}.png"}}
{{#container-layer}}
{{#each enabledLocations as |location|}}
{{#marker-layer location=location.location}}
{{#marker-popup}}
<p>Some HTML content goes here, potentially including {{boundProperties}} or <button {{action "doSomething"}}>actionable elements</button> which get handled by the parent route/component.</p>
{{/marker-popup}}
{{/marker-layer}}
{{/each}}
{{/container-layer}}
{{/ember-leaflet}} So to reflect popup content in the URL you would do: {{#marker-popup}}
{{outlet}}
{{/marker-popup}} And let Ember's router take care of the rest by using nested routes. |
As you know, related: #98 (comment) |
Yep, I remember that. Basically, it solves this case with very little "heavy lifting" on EmberLeaflet's side. Plus it looks a lot cleaner and is generally more flexible than something like This is just a thing to keep in mind when implementing those components. |
I was wondering if anyone had any ideas on how to reflect the popup state in the URL.
For example, if I had a map with a bunch of POIs and a user clicked the marker for a particular market, it would be great if the URL would change something like
/supermarkets/3424
or/supermarket/<some controller property>
.I have been digging around descending
SomeCollectionLayer._childLayers[n]._childLayers[n]
. This seems like the really wrong way to do this. How should I approach this problem?The text was updated successfully, but these errors were encountered: