Select to view content in your preferred language

Kill infoWindow

2987
14
03-25-2011 10:33 AM
ReneeMaxwell
Regular Contributor
I'm using the editing dijits and I'd like to turn off the infoWindow. I have a query for related records that fires whenever a feature is selected, and this query then populates a form that I have built on the page. I do NOT need the infoWindow but I can't figure out how to turn it off.
0 Kudos
14 Replies
KellyHutchins
Esri Frequent Contributor
When you create the map set the showInfoWindowOnClick option to false to disable the info window. Here's a code snippet that shows this:

map = new esri.Map("map", {
          extent: esri.geometry.geographicToWebMercator(new esri.geometry.Extent(-125.90, 44.60, -114.65, 50.22, new esri.SpatialReference({wkid:4326}))),
          showInfoWindowOnClick:false
        });
0 Kudos
ReneeMaxwell
Regular Contributor
Thanks Kelly! I appreciate the tip. Unfortunately it didn't work. I added that to my init() function but the infoWindow still pops up.
0 Kudos
ReneeMaxwell
Regular Contributor
FWIW, I wonder if this is a related issue - I can't get my map to enable zooming with the scroll wheel either. It appears that my map settings are having no effect whatsoever.

map = new esri.Map("map", {
        enableScrollWheelZoom: true,
        showInfoWindowOnClick:false
});


Any ideas as to why these settings are not being honored?
0 Kudos
KellyHutchins
Esri Frequent Contributor
I re-read your initial post and this is because you are using the editor. The editor uses the info window to display attribute information. Can you tell me a bit about how you are using the editor, for example are you using it just to create new features - or are you using the toolbar etc?
Thanks Kelly! I appreciate the tip. Unfortunately it didn't work. I added that to my init() function but the infoWindow still pops up.
0 Kudos
ReneeMaxwell
Regular Contributor
I am not using the editor toolbar, but I am using the template picker. I'm using it to create new features and to edit feature attributes. However, most of the attributes are all housed in related business tables so I'm using a lot of custom code.

I don't want to use the infoWindow for a couple of reasons. First, it's not big enough to edit all the fields I need to display. Second, it's location is related to the position of the feature on the screen, and this often means that it gets cut off if the feature is near the top of the screen.
0 Kudos
KellyHutchins
Esri Frequent Contributor
enableScrollWheelZoom isn't set via the Map's constructor. Try this after the map is created.

map.enableScrollWheelZoom();

You can find more details about map navigation here:
http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/intro_navigation.htm

FWIW, I wonder if this is a related issue - I can't get my map to enable zooming with the scroll wheel either. It appears that my map settings are having no effect whatsoever.

map = new esri.Map("map", {
        enableScrollWheelZoom: true,
        showInfoWindowOnClick:false
});


Any ideas as to why these settings are not being honored?
0 Kudos
ReneeMaxwell
Regular Contributor

enableScrollWheelZoom isn't set via the Map's constructor. Try this after the map is created.

map.enableScrollWheelZoom();


That was my original code. That doesn't work either.
0 Kudos
KellyHutchins
Esri Frequent Contributor
That was my original code. That doesn't work either.


You have to wait until the map is loaded for this to work, are you doing something like this?

dojo.connect(map, "onLoad", function() {
  map.enableScrollWheelZoom();
});
0 Kudos
KellyHutchins
Esri Frequent Contributor
Although scrollWheelZoom should be enabled by default so perhaps there is something else going on in your case. If you run one of the samples can you use your mouse scrolling to zoom?
0 Kudos