Select to view content in your preferred language

Would like to turn off Identify symbology

765
3
Jump to solution
04-29-2013 01:04 PM
MarcWeinshenker1
Regular Contributor
I have cobbled together a javascript map application to be used for determining if an address is within our City limits.  The application combines functionality of the geocode and identify samples.  After pressing the Locate button, an address is found, zoomed to, marked by a symbol, and then a popup automatically appears to display Identify results of whether the location is in City limits or not.

Here is the URL for the map:  http://maps.rockvillemd.gov/RKV_addresses/  (I have disabled zooming to the result in order to demonstrate the problem.)

Note that the outline of the polygon for within City limits is highlighted, but I don't need or want that for the purpose of this app.  How can I disable or null out the highlighting of the polygon which is the object of the Identify function? 

I won't copy the source code here since it is visible in the web page.  This is my first attempt at a javascript map, so you can take that into consideration.  I did get some help from someone who knows javascript but not GIS.

Thanks,
Marc
0 Kudos
1 Solution

Accepted Solutions
DianaBenedict
Frequent Contributor
The highlight of the polygon is controlled by your InfoWindow; which in this case is your Popup. If you create a new popup object and set the contructor option of highlight: false .. you might get that to turn off.

new esri.dijit.Popup(options?, srcNodeRef)
http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/popup.html

There are plenty of samples in the Javascript API to guide you through creating and setting the popup object as you infoWindow. Below is a simple example that shows you how you can create the popup object and then hook it up to your map. Note that I went ahead and showed you were you might be able to get this to work in your code. Have not tested this so it might still need some tweaking.

function init() {  var popup = new esri.dijit.Popup({     highlight: false }, dojo.create("div"));  /*var infoWindow = new myModules.InfoWindow({   domNode: dojo.create("div", null, dojo.byId("map")) });*/  map = new esri.Map("map", { basemap: "streets",   infoWindow: popup,   center: [-77.16, 39.09],   zoom: 13 });  //or you can set it seperately if want to wait till later by using the setInfoWindow method. //map.setInfoWindow(popup);

View solution in original post

0 Kudos
3 Replies
DianaBenedict
Frequent Contributor
The highlight of the polygon is controlled by your InfoWindow; which in this case is your Popup. If you create a new popup object and set the contructor option of highlight: false .. you might get that to turn off.

new esri.dijit.Popup(options?, srcNodeRef)
http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/popup.html

There are plenty of samples in the Javascript API to guide you through creating and setting the popup object as you infoWindow. Below is a simple example that shows you how you can create the popup object and then hook it up to your map. Note that I went ahead and showed you were you might be able to get this to work in your code. Have not tested this so it might still need some tweaking.

function init() {  var popup = new esri.dijit.Popup({     highlight: false }, dojo.create("div"));  /*var infoWindow = new myModules.InfoWindow({   domNode: dojo.create("div", null, dojo.byId("map")) });*/  map = new esri.Map("map", { basemap: "streets",   infoWindow: popup,   center: [-77.16, 39.09],   zoom: 13 });  //or you can set it seperately if want to wait till later by using the setInfoWindow method. //map.setInfoWindow(popup);
0 Kudos
derekswingley1
Deactivated User
Diana's answer will do what you want�?? specifying highlight: false will cause features associated with the popup to not be highlighted.

Here's an alternate solution where the address point (rather than the city limits polygon) is passed to the popup:  http://jsfiddle.net/95KYJ/

Note line 87 (which I've commented out):
map.infoWindow.highlight = false;
0 Kudos
MarcWeinshenker1
Regular Contributor
Thank you Diana and Derek.  I'm not experienced enough to fully follow what you've done, but having something that works goes a long way.  Much appreciated.

Marc
0 Kudos