12 votes
Accepted

How to add layers and update layer control dynamically : leaflet

There are public methods in L.Control.Layers control to add base layers and overlays dinamically (see full reference): addBaseLayer(layer, name) to add new base layer addOverlay(layer, name) to add ...
user avatar
7 votes

Is esri-leaflet officially an Esri project on github?

Yes. more generically, anything found at https://github.com/Esri can be considered an 'official' project because the url references our 'Organization' (in Github's parlance). https://help.github.com/...
user avatar
  • 5,053
6 votes
Accepted

How to iterate through the attributes of a feature in Leaflet?

If my understanding is correct, you want to read all properties of the given event layer, without knowing in advance which properties are set and available? In that case, this is a simple JavaScript ...
user avatar
  • 6,853
5 votes
Accepted

Displaying ESRI REST services in MapBox?

You can almost certainly replace the mapbox.js library with leaflet.js. And I'd be surprised if the esri-leaflet library doesn't just work with the MapBox version of leaflet. I've got an old trivial ...
user avatar
  • 13.1k
4 votes
Accepted

Can I use esri-leaflet together with arcgis api?

esri leaflet is an alternative to the ArcGIS API for JavaScript, not something that makes much sense to try and combine. L.esri.DynamicMapLayer provides comparable functionality (within Leaflet) for ...
user avatar
  • 5,053
4 votes

Is esri-leaflet officially an Esri project on github?

It's official: http://blogs.esri.com/esri/arcgis/2013/07/31/new-esri-open-source-javascript-projects-leaflet-geoservices-js-terraformer-pushlet/ And make sure you spell it Esri... ESRI is so 2009...
user avatar
4 votes

L.esri.featureLayer shows up and sometimes not

I think this is an issue with CORS. The layer you are trying to use is on an older version of server (10.0x) which mean that it does not ship with support for cross origin requests (CORS) out of the ...
user avatar
4 votes
Accepted

Leaflet zoom to polygon

It should be quite easy by using the onEachFeature option of the L.esri.featureLayer, combined with shapes getBounds() and map fitBounds(). HTML: <div id="map"></div> <p>List of ...
user avatar
  • 6,853
4 votes
Accepted

Esri leaflet plugin only showing North America tile?

Leaflet includes information about the WGS84 coordinate system generally, but you'll still need to provide information about the origin and levels of detail of your own cached service in order for it ...
user avatar
  • 5,053
4 votes
Accepted

Esri Leaflet identify() only on added layer from MapService

By default L.esri.IdentifyFeatures queries all the layers in the map service. https://github.com/Esri/esri-leaflet/blob/v2.2.3/src/Tasks/IdentifyFeatures.js#L20 From the looks of your codepen, it ...
user avatar
  • 5,053
4 votes
Accepted

Leaflet event onclick zoom in and out (JavaScript)

Assuming your map variable is called map, this zooms in when you click the map: map.on('click', function() { map.zoomIn(); }); If you're asking to fire an event when zooming happens, then use: ...
user avatar
  • 6,249
3 votes
Accepted

Can we set the latlng start point : leaflet

First, read the source code for L.CRS.Simple, particularly, this line: transformation: toTransformation(1, 0, -1, 0), That is a factory method to instantiate an affine transformation from L....
user avatar
  • 9,380
3 votes

Leaflet: click feature to get external diagram

if you are using Esri's plugins for Leaflet you already have an event listener to utilize and the feature's attributes are already available via the GeoJSON properties. yourLayer = L.esri....
user avatar
  • 5,053
3 votes
Accepted

Change point symbol in mapbox.js/leaflet/esri-leaflet.js

in order to style the markers that L.esri.featureLayer helps you add to the map, you can use L.icon. see this leaflet tutorial and this example for more info.
user avatar
  • 5,053
3 votes

Problem loading specific WMS with leaflet

I have no problems loading that WMS service, see live example here. var wms = L.tileLayer.wms('https://glfc72.cfsnet.nfis.org/mapserver/cgi-bin/mapserver.cgi?', { map: '/data/htdocs/glfc.cfsnet....
user avatar
  • 9,380
3 votes

Show an esri leaflet feature's popup by default

featureLayer.bindPopup() isn't triggered until users interact with an individual graphic. if you want a popup to be created and opened immediately, you can do it yourself using the opportunity ...
user avatar
  • 5,053
3 votes
Accepted

Leaflet access dynamic layers globally

Just keep their names in an array in the window object, such as: window.dynamicLayerNames = []; let url = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Infrastructure/MapServer";...
user avatar
  • 363
3 votes

Selecting all objects with specific value from GeoJSON in new variable

This is probably more of a question for stackoverflow directly, however if you are able to use ES6, you could use something like this: const filteredFeatures = kitespots.features.filter(item => { ...
user avatar
2 votes

How to re-implement a Dojo application using Leaflet?

i wrote a quick example of loading dojo and leaflet in the same application here that being said, if you are committed to using dojo, it probably makes more sense to maintain a mapping application ...
user avatar
  • 5,053
2 votes
Accepted

Leaflet & Esri-Leaflet: JSON objects not drawing correctly when using 'fields' filter

a couple things here... that constructor option expects an array at a minimum, you have to include the OBJECTID field in that array in order for everything to work on the clientside as it should. { ...
user avatar
  • 5,053
2 votes

Esri leaflet functionality

The Esri Leaflet plugin does not provide this capability directly. However, it already does the heavy lifting of converting Esri Geoservices JSON into GeoJSON for clientside display. This means that ...
user avatar
  • 5,053
2 votes

Projecting ArcGIS Tiled Service for Esri-Leaflet?

There could be something else going on here as well, but its a problem that the service you are attempting to display has 512 pixel tiles (instead of 256). Proj4Leaflet has a constructor option for L....
user avatar
  • 5,053
2 votes
Accepted

Changing marker size by zoom in Leaflet?

you can add a zoom listener to your map to change the icons at different zoom levels. Here is a simplified example. You can change the conditions and icons to fit your project: <html> <head&...
user avatar
  • 6,738
2 votes
Accepted

Leaflet: click feature to get external diagram

You can take the feature attributes and hand them over to the charting library. If you don't need to change a lot at the chart-design you can also just use C3.js which makes it easyer to start ;) ...
user avatar
  • 6,350
2 votes
Accepted

dynamicMapLayer esri-leaflet does not return properties of point data

your sample is working fine for me. if you're having trouble clicking on point features, consider calling tolerance() and passing in a number of screen pixels greater than the default value of 3. ...
user avatar
  • 5,053
2 votes

proj4leaflet with esri-leaflet 1.0.4

You forgot to include the most important part of the message! L.esri.TiledMapLayer is using a non-mercator spatial reference. Support may be available through Proj4Leaflet this isn't a complaint, ...
user avatar
  • 5,053
2 votes
Accepted

Adding button to move map Direction in Leaflet?

You can start here: Leaflet.Pancontrol. Check the code repository and download code to your plugins folder inside leaflet folder. Then in code just reference to the js file/files.
user avatar
  • 739
2 votes
Accepted

Leaflet popup does not work with esri rest feature services

This is happening because the points are being drawn below the polygon graphics. The example below demonstrates how to use Leaflet panes to get control over draw order and make sure the points are ...
user avatar
  • 5,053
2 votes

Correct way to determine the type of Leaflet layer?

This isn't really a Leaflet issue, but a general one with Javascript. And it specifically concerns when you want the objects's name. For comparisons, there are plenty of ways to do it safely (as in ...
user avatar
  • 1,709
2 votes
Accepted

Leaflet error: h.fn is undefined when using layer.on('loading') event

you can (and should) skip including the parentheses when you wire up your event listener to a named function. layer.on('loading' , cursorWait); // not cursorWait() it appears also when I zoom in ...
user avatar
  • 5,053

Only top scored, non community-wiki answers of a minimum length are eligible