Allow to use a variable for webmapid attribute#297
Conversation
The webmapid have to be hardcoded in the html template file, with this change we can use a variable :
<esri-map id="map" webmap-id="{{mapSurface.mapConfig.webmapId}}" item-info="itemInfo" load="mapSurface.mapLoaded">
</esri-map>
|
Thanks @stephguignard Would you mind providing a test page that demonstrates the new functionality? You could copy the existing web map test page and update it to pull the web map from the scope instead of being an inline attribute. If you feel ambitious, you could also add the corresponding e2e test by copying the web map spec as well. If you don't feel up to that, we can add that. |
|
Hi @tomwayson Ok, I created files (example and test) My usecase for this parameter is not to change webmap id on the same view. If someone need this functionality, they must change the code in EsriMapController.js to destroy the map before to load the new one. In my application, I use the tag inside my own directive and I have several different webmapid in different views. BR, |
|
Hi @stephguignard, Thank you for opening this PR with the requested changes to the v1 code. I reviewed and tested out your changes and they're a very helpful contribution. I just have two tiny requests for you:
Thanks, and after that I can take care of merging. |
|
Hi @jwasilgeo, I did the changes. Thanks, |
|
@stephguignard thank you! |
The webmapid have to be hardcoded in the html template file, with this change we can pass a variable and then this variable mapSurface.mapConfig.webmapId will be evaluated.
It is easier for the configuration when we use multiple webmapid in the same application.
For example :