Reputation: 1
I have an old esri-leaflet map that queries and displays a feature from a published feature service. I'm migrating the dashboard that uses this map to a new server that requires https. I keep getting this error, and I have no idea what's wrong.
Old code (works great):
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="json2.js"></script>
<script src="http://cdn-geoweb.s3.amazonaws.com/esri-leaflet/0.0.1-beta.6/esri- leaflet.js"></script>
<script src="http://cdn-geoweb.s3.amazonaws.com/esri-leaflet-renderers/0.0.1-beta.3/esri-leaflet-renderers.js"></script>
New code:
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet-src.js"></script>
<script src="https://unpkg.com/esri-leaflet@3"></script>
<script src="https://unpkg.com/esri-leaflet-renderers@3"></script>
This is where it fails, trying to query the feature layer:
q="OBJECTID="+params.objectid;
n=params.name;
project = L.esri.featureLayer(
'https://dmdmaps.cabq.gov/serverext/rest/services/Public/Active_CABQ_Construction_Projects/FeatureServer/1',
{ where:q }
).addTo(map);
Any ideas on how to fix this?
Upvotes: 0
Views: 796
Reputation: 404
the API signature to instantiate a featureLayer
changed at version 1.x of esri leaflet.
L.esri.featureLayer({ url, where })
Upvotes: 1