POST
|
You need to set the useCors option to false on the layer since the MapService doesn't support CORS. You can see this in the Custom Popup with Dynamic Map Layer | Esri Leaflet example.
... View more
10-21-2014
09:17 AM
|
0
|
4
|
27
|
POST
|
Could you elaborate on what "Windows Authentication" means? Esri Leaflet support oAuth 2 with ArcGIS Online. There is an example here Access premium ArcGIS Online content | Esri Leaflet .
... View more
10-17-2014
02:36 PM
|
0
|
4
|
11
|
POST
|
The MIME type error is ignorable. It never cases any problems. Can you post any sample code (or JS Fiddle/CodePen) to show the problem you are seeing?
... View more
10-17-2014
02:34 PM
|
0
|
6
|
27
|
POST
|
There a couple of problems with your above code sample. 1. You are listening for `map.on(click`, someFunction). This will fire when the map is clicked, not your checkbox. 2. The code in your click event handler checks if the checkbox is checked (which in your demo it is) and then adds/removes the layer. So when the map is clicked if the checkbox is also checked, add the layer, otherwise remove the layer. 3. The layer is being added to the map because you are calling .addTo(map) at the end of the line where you assign livello. If you want the layer off by default you need to not call this line. 4. The checkbox is checked by default because you have set checked="checked" on it. What I think you are trying to achieve is this. 1. A checkbox whose state is paired to the visibility of a layer 2. Checkbox and layer should be off my default cleaned up your code a bit to reflect what I think you are actually trying to achieve. CodePen - A Pen by Patrick Arlt
... View more
10-16-2014
09:16 AM
|
0
|
8
|
42
|
POST
|
Also forgot you could also use L.esri.get to query the endpoint directly and let the server do the spatial query for you.
L.esri.get(featureLayerQueryUrl, {
spatialRel: "esriSpatialRelIntersects",
geometryType: "esriGeometryPoint",
geometry: L.esri.Utils.geojsonToArcGIS(geojsonPoint)
}, function(error, response){
var geojson = L.esri.Utils.responseToFeatureCollection(response);
});
This is dropping down pretty low into the request and utilities methods. But you will save yourself from using Turf and they are all documented in the API ref API Reference | Esri Leaflet
... View more
10-16-2014
08:49 AM
|
0
|
1
|
37
|
POST
|
I get where you are coming from Rene. You were probably hoping for something like this
L.esri.featureLayer(featureLayer, {
spatialMethod: 'intersects',
geometry: latlng
}).addTo(map);
Implementing this would be VERY difficult since the assumption that features are only loaded inside the current viewport is baked into Esri Leaflet all the way down to the core. That said this did remind me of a feature I wanted to add Add additional spatial query types to L.esri.Tasks.Query · Issue #374 · Esri/esri-leaflet · GitHub. Once this is implemented you could do something like the following to render all polygons that intersect a point.
L.esri.Tasks.query(featureLayer).intersects(latlng).run(function(error, geojson){
// use L.GeoJSON to add features to map
});
For right now you can just use the raw L.esri.Tasks.query to query as many features as possible and use Turf on the client side for your point in polygon.
// queries all features up to the transfer limit (usually 1000-2000)
L.esri.Tasks.query(featureLayer).run(function(error, geojson){
// now use Turf over all the geojson
});
... View more
10-16-2014
08:44 AM
|
1
|
0
|
37
|
POST
|
Barrett, Your right that the example on the website is incorrect. However it SHOULD be corrected and work. I've made an issue to track this for the next release Methods accepting LatLng and LatLngBounds should also accept simple forms. · Issue #373 · Esri/esri-leaflet · GitHub. Generally Leaflet will let you pass a LatLng, [lat,lng] or {lat: lat, lng: lng} object. Esri Leaflet needs to do the same. For now your workaround of wrapping the input in a L.LatLng si the right way to go.
... View more
10-16-2014
08:30 AM
|
0
|
0
|
2
|
POST
|
This place will serve as a discussion forum and community support area for Esri Leaflet. My hope is to eventually direct traffic away from GitHub issues and toward here or the GIS Stackexchange. Lets all work towards making Esri Leaflet the best it can be!
... View more
09-11-2014
07:52 PM
|
0
|
0
|
804
|
POST
|
I updated the code on https://github.com/Esri/esri-leaflet/issues/233 it looks like the only way to do this. The following is from the jQuery docs for double click http://api.jquery.com/dblclick/ [INDENT] It is inadvisable to bind handlers to both the click and dblclick events for the same element. The sequence of events triggered varies from browser to browser, with some receiving two click events before the dblclick and others only one. Double-click sensitivity (maximum time between clicks that is detected as a double click) can vary by operating system and browser, and is often user-configurable. [/INDENT] As an alternative why not bind the identify to the contextmenu event on Leaflet? which is fired on right click (desktop) or long press (mobile)?
... View more
04-07-2014
04:37 PM
|
0
|
0
|
10
|
POST
|
Since this behavior is specific to how you want your app to work and how to make identify calls I don't think its the responsibility of Esri Leaflet to handle this for you. Especially since it would involve modifying Leaflets default behavior. I have posted a solution for a click-to-identify/double-click-to-zoom experience in this GitHub issue https://github.com/Esri/esri-leaflet/issues/233 . I will however look into integrating this into https://github.com/Esri/esri-leaflet/issues/28 when I do popup helpers for dynamic map layer.
... View more
04-07-2014
08:51 AM
|
0
|
0
|
10
|
Online Status |
Offline
|
Date Last Visited |
11-17-2020
12:57 PM
|