Ok, Now I’m really confused, because my mapservice is behind a firewall, I found one that wasn’t and using the same code the new example worked while my service doesn’t. So just changing the url gives me a working example, the only thing I can see different is the field names.
My code:
// Hosp Points
var hosp = L.esri.featureLayer()
}}).addTo(map);
hosp.bindPopup(function (evt) {
return L.Util.template(' Name: {NAME}
ID: ', evt.feature.properties); //Both services have a NAME and ID field..
});
MY service fields:
• DOHGIS.NYSDOH_CI_DATA.OBJECTID ( type: esriFieldTypeOID , alias: OBJECTID )
• DOHGIS.NYSDOH_CI_DATA.ID ( type: esriFieldTypeString , alias: Facility ID , length: 35 )
• DOHGIS.NYSDOH_CI_DATA.IDTYPE ( type: esriFieldTypeString , alias: Facility ID Type , length: 100 )
• DOHGIS.NYSDOH_CI_DATA.NAME ( type: esriFieldTypeString , alias: Facility Name , length: 250 )
The working service fields:
It must be related to the SDE Instance/Table/FieldName structure.
DOHGIS.NYSDOH_CI_DATA.NAME gives me a popup that says: ‘Name: { DOHGIS.NYSDOH_CI_DATA.NAME}’
NAME errors off, says No value provided for variable
Using the field Alias:
Facility Name gives me a popup that says: ‘Name: { Facility Name }’
“Facility Name” gives me a popup that says: ‘Name: { “Facility Name” }’