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

make check for custom CRS smarterer #1045

Merged
merged 2 commits into from
Feb 7, 2018
Merged

make check for custom CRS smarterer #1045

merged 2 commits into from
Feb 7, 2018

Conversation

jgravois
Copy link
Contributor

@jgravois jgravois commented Feb 7, 2018

resolves #1019

took a look at this today and realized that the problem @theashyster reported also causes an unnecessary console error outside of webpack when a simple WGS84 tile service is added to a map.

var map = L.map('map',{crs: L.CRS.EPSG4326}).setView([45,-125], 3);

L.esri.tiledMapLayer({
  url: 'http://services.arcgisonline.com/arcgis/rest/services/ESRI_Imagery_World_2D/MapServer'
}).addTo(map);

instead of checking to see whether a) the map and tiled service are both web mercator and b) if proj4 is available we can instrospect the CRS defined for the map and make sure the supplied code is the same one the service is using.

@jgravois jgravois merged commit 2593cc7 into master Feb 7, 2018
@jgravois jgravois deleted the patch1019 branch February 7, 2018 00:34
return true;
} else if (map.options.crs && map.options.crs.code && (map.options.crs.code.indexOf(spatialReference) > -1)) {
// using proj4 and defining a custom crs enables support for tile services published in other projections
return true;

Choose a reason for hiding this comment

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

Hey, today I found the time to test out the newest version of esri-leaflet and sadly it did not work out as I hoped for.
Before the changes things related to proj4 would go into the else block and show a warning if proj4 was missing (which caused the original issue I described here #1019).
After the changes things related to proj4 goes into the main block and fires lodmap event.
Because of this, I only get the initial map loaded and when I do zooming or dragging around the map no other base map tiles are loaded or even requested to be loaded.

Here is the issue visible on Plunker https://plnkr.co/edit/kFneHCA8CBMpAbg12mwp?p=preview
And if you just change the version to [email protected] in the index.html you would see that it works fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ugh. totally my fault. fix is in #1051.

Choose a reason for hiding this comment

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

Heh, no problem, thanks for the fast fix 👍

jgravois added a commit to jgravois/esri-leaflet that referenced this pull request Apr 23, 2022
make check for custom CRS smarterer
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.

proj4 is not defined in TiledMapLayer
2 participants