Using ESRI's feature server with leaflet

1113
4
06-21-2014 12:14 PM
joepublic
New Contributor III
Hello....

I have an ESRI feature service; Layer: Administrative boundary (0) and Tables: MEP_global_data.DBO.mep_catalog (1)

I've done lots of reading and looked at various examples but can't get the following snippet of code to work (i.e. the popup)...

The same code works for the administrative boundary(0)

Any idea what's I am missing??

Thanks
Chris

var MEP1=L.esri.featureLayer('http://dev.consciousglobalchange.org/arcgis/rest/services/MEP/webmap_catalog/FeatureServer/1', {
   style:function (feature) {
     return { color: "#70ca49", weight: 2 };
   }
   onEachFeature: createPopup
   }).addTo(map);

function createPopup(geojson,layer) {
// Show all data
0 Kudos
4 Replies
JohnGravois
Frequent Contributor
hi joe,

layer '1' is just a flat table with no geometry, so esri-leaflet has nothing to draw on the map.
0 Kudos
joepublic
New Contributor III
I just realized that after speaking to the person who created the files.

Layer: Administrative boundary (0) and Tables: MEP_global_data.DBO.mep_catalog (1)  are linked by a country code column in each.

When I click on the country displayed via leaflet in my browser, I want popup that displays data from the catalog table that is linked to the country via the country code in both the layer and the table.  Is their an example that does something similar I can review??

Thanks
0 Kudos
JohnGravois
Frequent Contributor
i haven't seen any samples like that, but i think its a good idea.

https://github.com/Esri/esri-leaflet/issues/272
0 Kudos
joepublic
New Contributor III
jgravois,

Thanks!!
I look forward to your example.

Chris
0 Kudos