dojo.forEach(layers, function(layer) { dojo.connect(layer, "onClick", function(evt) { dojo.stopEvent(evt); editToolbar.activate(esri.toolbars.Edit.EDIT_VERTICES , evt.graphic); }); });
dojo.connect(templatePicker, "onSelectionChange", function() { if(templatePicker.getSelected()){ //template selected disable non-editable featLayers onClick event dojo.forEach(nonEditFeatLayers, function(layer){ layer.disableMouseEvents(); }); } else{ //template selection cleared, enable onClick dojo.forEach(nonEditFeatLayers, function(layer){ layer.enableMouseEvents(); }); } });
#map_infowindow { display:none; visibility:hidden; } .window { display:none; visibility:hidden; }
This example does not use the editor to edit the feature shapes. If I load my feature layer in my application but disable the editor then sure enough I can customise the infoTemplate and even stop the infoWindow appearing as you suggest in an earlier post, but with the editor and template picker in use on the feature layer I cannot control the infoTemplate and cannot prevent the infoWindow appearing. Do you have any more suggestions?Thanks again.
Hi,I appreciate all your responses, but I'm still getting nowhere. I have tried defining an infoTemplate, but the infoWindow that appears when I click a shape for editing is just the default template, for some reason I don't seem to be able to alter it. Below is my code that runs to load the editor service if that gives any clues. I haven't used the infoTemplate before so I could be getting it wrong. Also, I still have the code in place which should stop the window appearing anyway, and that's not taking effect. If you have any working code you don't mind sharing then please post it. Thank you.function loadEditor() { infoTemplate = new esri.InfoTemplate(); infoTemplate.setContent("<b>Reference: </b>${APP_REF}"); planAppsLayer = new esri.layers.FeatureLayer("http://myServer/ArcGIS/rest/services/Test/myService/FeatureServer/0", { mode: esri.layers.FeatureLayer.MODE_ONDEMAND, infoTemplate: infoTemplate, outFields: ["*"] }); dojo.connect(map, "onLayersAddResult", initEditing); map.addLayers([planAppsLayer]) }
function loadEditor() { infoTemplate = new esri.InfoTemplate(); infoTemplate.setContent("<b>Reference: </b>${APP_REF}"); planAppsLayer = new esri.layers.FeatureLayer("http://myServer/ArcGIS/rest/services/Test/myService/FeatureServer/0", { mode: esri.layers.FeatureLayer.MODE_ONDEMAND, infoTemplate: infoTemplate, outFields: ["*"] }); dojo.connect(map, "onLayersAddResult", initEditing); map.addLayers([planAppsLayer]) }
Hi,No, that doesn't work either, I have:map = new esri.Map("mapDIV", { extent: customExtent, showInfoWindowOnClick:false });And the infoWindow still appears when editing, the above probably only applies to the Identify. Any chance you feel like trying it to make sure it's not just me?Thanks.
Hi,These don't work. I have tried both. The problem is the hide(), it is not a 'stop', so the infoWindow still shows, so in the case of the event ideas you suggest I expect the hide() actually fires before the show, or I can put some logic in my code to hide() a split second after the show, but the infoWindow still shows for a split second. I think I need to disable the infoWindow by some other technique but I don't know what. With the Identify code you actually code the infoWindow.show() to open the infoWindow at the appropriate time, but that seems to be hidden with the editor.Mark.
Hi,Thanks for that. What event works with this? I have tried a few things that don't work, and I can use map.infoWindow.hide() to hide the window a split second after it appears, but not to stop it appearing in the first place. Can you please post the code?Thanks.
Hi,Hopefully a simple one, but I can't crack it.I'm using the editor and template picker to allow editing of a layer through the API and this works great. However in this instance there is no need for the infoWindow to appear when a user clicks a shape to edit, i.e. I don't want it to pop-up, I just want to be able to edit the shape, not the attributes. So how do you prevent the infoWindow appearing?Thank you,Mark.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.