-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic Map Service Popups #28
Comments
I think this a good idea, but there are some implementation issues. I am assuming you would like some kind of built in version of this sample from the Javascript SDK http://developers.arcgis.com/en/javascript/sandbox/sandbox.html?sample=find_popup The biggest problem here is that we dont know how developers want the data displayed. They might want only one property or the layer id or a whole custom template with graphs and bells and whistles. It might be best to leave this alone for now and make a demo showing this behavior. @alaframboise could you whip something up? There are 2 directions I think we could go in if we want to do a
Option 2 could look something like this. layer = new L.esri.dynamicLayer(url);
layer.bindPopup(function(identifyInfo){
// do custom logic to build a template
// return the html string you want inserted into the popup.
return html;
}); |
When implementing the popup we should also consider the capability of pulling the pop-up information (graphs,pictures,custom attribute display...) from an ArcGIS.com Web Map and have it display in a similar fashion within the leaflet application. Similar to this: https://developers.arcgis.com/en/javascript/jssamples/ags_createwebmapid.html |
@kevinsigwart You shouldn't need to create global variables. map.on("click", function(event) {
dynLayer.identify(event.latlng, setupIdentifyHandler(event));
});
function setupIdentifyHandler(event) {
return function (data) {
if (data.results.length > 0) {
var popup = L.popup()
.setLatLng(event.latlng)
.setContent(data.results[0].value)
.openOn(map);
}
};
} |
Provide Popup support for Dynamic Layers. Currently, we need to create a global variable for the map on click event result, then use that result within the identify result callback. It would be nice if the popup would work similarly to the feature service.
Here is how I currently handle the popup.
The text was updated successfully, but these errors were encountered: