Leaflet- DynamicMapLayer popup help

4115
3
Jump to solution
03-01-2016 11:18 AM
BillChappell
Occasional Contributor II

Hi,

I'm trying to make a simple leaflet map with a popup but I'm having trouble with the field name in the popup.

Following the example Custom Popup with Dynamic Map Layer | Esri Leaflet  you can see the popup is based on featureCollection.features[0].properties.FIELDNAME, my issue is my data is in SDE and I get this:

DOHGIS.NYSDOH_CI_DATA.NAME ( type: esriFieldTypeString , alias: Facility Name , length: 250 )

featureCollection.features[0].properties.DOHGIS.NYSDOH_CI_DATA.NAME  doesn't work because of the periods in the name.

featureCollection.features[0].properties.NAME  doesn't work..

If I use the alias I get

featureCollection.features[0].properties."Facility Name" this doesn't work because of the quotes and space.

var temp = "Facility Name"

featureCollection.features[0].properties.temp; also fails.

Of course fieldnames with an underscore instead of a space work.

Beyond adding new fields to fix the database any ideas?

Thanks,

Bill

0 Kudos
1 Solution

Accepted Solutions
BillChappell
Occasional Contributor II

featureCollection.features[0].properties["Facility Name"];

Got It...   I removed the period after the properties and encased my quotes within brackets.

View solution in original post

3 Replies
BillChappell
Occasional Contributor II

featureCollection.features[0].properties["Facility Name"];

Got It...   I removed the period after the properties and encased my quotes within brackets.

View solution in original post

SteveOchieng
New Contributor II

Hi Bill,

I am experiencing this problem and I have tried the solution you are suggesting here but it can't seem to work for me. Did you find something else along this line that can help me

I have put mine this way featureCollection.features[0].properties['PLOTNO_1'] I have also tried " " but I still get undefined.

Assit please!

0 Kudos
BillChappell
Occasional Contributor II

Sorry i was never notified of your question, did you ever figure this out?

I know upper/lower case makes a difference, and in GeoJSON without SDE it's features[0].properties.FIELDNAME

0 Kudos