You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Ember-noob question I was hoping someone could help me out with. I'm having some trouble figuring how to make an extension. To illustrate, I have a rather staightforward use in my template right now. Just an address marker with an info window with some custom content:
{{#g-mapmarkersFitMode="live"as |context|}}{{#g-map-address-markercontextaddress=shop1.addressas |markerContext|}}{{#g-map-infowindowmarkerContext}}
<h5>{{shop1.name}}</h5>
<p>{{shop1.address}}, {{shop1.postalCode}}, {{shop1.city}}</p>
{{/g-map-infowindow}}{{/g-map-address-marker}}
{!-- and lots more of such g-map-address-markers but with a different model --}
{{/g-map
Basically I have a whole list of shops/studios/etc on the map, and it would be nice to make a component that just takes a model as the source of the information so I don't have to repeat that code and structure it better. So I make my own component mp-map-location with the following code:
Which I was naively hoping would allow me to simply use the following template code:
{{mp-map-locationlocation=shop}}
Now in the original code there's {{#g-map-address-marker context address=general.address as |markerContext|}} which seems to do some essential context binding, and I'm just clueless on how to ensure that still happens with my extension. It's probably also why currently I get the error:
Uncaught Error: Assertion Failed: Must be inside {{#g-map}} or {{#g-map-marker}} components with context set
Sorry if this is not the best place to ask this but since it seemed pretty specific to this addon architecture. Any help on how to get this started is much appreciated!
The text was updated successfully, but these errors were encountered:
For your case it's better not to extend it, but just make it a component which is calling g-map-address-marker inside it's template and transfer map context down to it.
Hi,
Ember-noob question I was hoping someone could help me out with. I'm having some trouble figuring how to make an extension. To illustrate, I have a rather staightforward use in my template right now. Just an address marker with an info window with some custom content:
Basically I have a whole list of shops/studios/etc on the map, and it would be nice to make a component that just takes a model as the source of the information so I don't have to repeat that code and structure it better. So I make my own component
mp-map-location
with the following code:And the following template
Which I was naively hoping would allow me to simply use the following template code:
Now in the original code there's
{{#g-map-address-marker context address=general.address as |markerContext|}}
which seems to do some essential context binding, and I'm just clueless on how to ensure that still happens with my extension. It's probably also why currently I get the error:Sorry if this is not the best place to ask this but since it seemed pretty specific to this addon architecture. Any help on how to get this started is much appreciated!
The text was updated successfully, but these errors were encountered: