Based on your it looks like the issue you are seeing is features you add to the datasource
directly in code and attaching to the polygonLayer
and pointLayer
are working as expected, but the data you are importing into the data source of the drawing manager is not displaying a popup when clicked.
The simple reason for this is that you haven't added a click event to the layers used to render the imported GeoJSON. That imported GeoJSON data is being rendered on the map by layers in the drawing manager. You can add a click event to these layers, however you will likely want to add some logic that only shows a popup with the drawing manager is in an idle state (not drawing or editing), otherwise that might lead to some odd behavior. Here is a code sample:
var layers = drawingManager.getLayers();
//Add click event to layers of the drawing manager.
map.events.add('click', [
layers.polygonOutlineLayer,
layers.polygonLayer,
layers.lineLayer,
layers.pointLayer
], drawingLayerClicked);
function drawingLayerClicked(e) {
//Check if drawing manager is idle.
if(drawingManager.getOptions().mode === 'idle') {
//Pass the event through to the feature click event handler.
featureClicked(e);
}
//Otherwise ignore the event.
}