I've added in the measurement widget to my project, but now I am trying to turn the pop-ups off while the widget is in use. I've tried the different solutions that have been mentioned in other forum threads on this topic without any luck. I'm still pretty new to the JavaScript API, so I imagine this is a much easier fix than I'm making it out to be.
Here's an example of one of my infoTemplates, should that be helpful in resolving this:
//Create Trails InfoTemplate var trailsInfoTemplate = new InfoTemplate(); trailsInfoTemplate.setTitle("<b>${Trail_Name}</b>"); var trailsInfoContent = "<div class=\"InfoContent\">" + "Trail Type: ${Trail_Type}<br><br>Located On: ${Tract}<br><br>Length (mi.): ${Mileage}" + "</div>"; trailsInfoTemplate.setContent(trailsInfoContent);
Here's the measurement widget portion of my project:
var snapManager = mapMain.enableSnapping({ snapKey: has("mac") ? keys.META : keys.CTRL }); var layerInfos = []; snapManager.setLayerInfos(layerInfos); var measurement = new Measurement({ map: mapMain }, dom.byId("measurementDiv")); measurement.startup();
Solved! Go to Solution.
Ashley,
You can disable the popups using aspect after
var measurement = new Measurement({ map: mapMain }, dom.byId("measurementDiv")); aspect.after(measurement, 'setTool', function() { if (measurement.activeTool) { mapMain.setInfoWindowOnClick(false); } else { mapMain.setInfoWindowOnClick(true); } }); measurement.startup();
Ashley,
You can disable the popups using aspect after
var measurement = new Measurement({ map: mapMain }, dom.byId("measurementDiv")); aspect.after(measurement, 'setTool', function() { if (measurement.activeTool) { mapMain.setInfoWindowOnClick(false); } else { mapMain.setInfoWindowOnClick(true); } }); measurement.startup();
Thanks Robert! I hadn't seen that solution in previous threads. Worked perfectly!