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

Basemaps updated for new ESRI API #182

Merged
merged 3 commits into from
Jul 20, 2022
Merged

Conversation

michaelpnelson
Copy link
Contributor

This updates basemap code for ESRI basemaps to use the esri-leaflet-vector library and accommodate the use of an API key. Docs are updated, debug examples are updated to use a non-ESRI basemap, and SMK's version is incremented.

This updates basemap code for ESRI basemaps to use the esri-leaflet-vector library and accommodate the use of an API key. Docs are updated, debug examples are updated to use a non-ESRI basemap, and SMK's version is incremented.
@michaelpnelson michaelpnelson self-assigned this Jul 20, 2022
@michaelpnelson michaelpnelson requested a review from dgboss July 20, 2022 17:21
var lys = []
lys.push( L.esri.basemapLayer( id, opt ) )
function createBasemapEsri( apiId ) {
const apiKey = SMK.MAP[1].viewer.esriApiKey;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lookup is unsafe, SMK.MAP[1] doesn't always exist. The '1' is the 'smk-id' and can be set by the user. See the SMK/Initialization docs for details.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll reinstate the passing around of the "esriApiKey" value that we get from the smk object in the initialization method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have a few other options for accessing the property:

  1. Object.getOwnPropertyNames
  2. Object.keys
  3. for const prop in my_object

@michaelpnelson michaelpnelson merged commit 40bae7b into master Jul 20, 2022
@michaelpnelson michaelpnelson deleted the basemaps_update_feature branch July 20, 2022 21:50
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

Successfully merging this pull request may close these issues.

2 participants