Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Allow to use a variable for webmapid attribute #297

Merged
merged 3 commits into from
Aug 9, 2016
Merged

Conversation

stephguignard
Copy link

  • Choose the appropriate base branch that you want to merge into:
    • v1.x for v1 (Esri JSAPI 3.x)
  • Describe the proposed changes:
    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 :

<esri-map id="map" webmap-id="{{mapSurface.mapConfig.webmapId}}" item-info="itemInfo" load="mapSurface.mapLoaded">
</esri-map>

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>
@stephguignard stephguignard changed the title Allow to use a variable for webmapid attribut Allow to use a variable for webmapid attribute Aug 4, 2016
@tomwayson
Copy link
Member

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.

@stephguignard
Copy link
Author

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,
Stéph.

@jwasilgeo jwasilgeo self-assigned this Aug 8, 2016
@jwasilgeo
Copy link
Contributor

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:

  • Can you please change the filename of your spec .js file to have the exact same filename as your new test .html file?
  • Would you be OK with removing these 2 commented lines (48,49)?

Thanks, and after that I can take care of merging.

@stephguignard
Copy link
Author

Hi @jwasilgeo,

I did the changes.

Thanks,
Stéph.

@jwasilgeo
Copy link
Contributor

@stephguignard thank you!

@jwasilgeo jwasilgeo merged commit 1964aee into Esri:v1.x Aug 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants