Select to view content in your preferred language

API 3.3 vs 3.4  moving an InfoWindow

1463
3
03-28-2013 09:31 AM
deleted-user-ATjHIWsdQYmT
Deactivated User
I'm trying to reposition an infoWindow based on the center of a polygon.  When using 3.3 API my code works just fine.  When I upgraded to 3.4 I get:
"Object doesn't support property or method 'move'".

Possible bug?

Here's my code:
var newPt = map.toScreen(tileResults.features[0].geometry.getExtent().getCenter());
map.infoWindow.move(newPt);
0 Kudos
3 Replies
SteveCole
Honored Contributor
I don't know how to fix your problem but I think the reason for the error is because ESRI changed the "default" info window to a popup instead of infoWindow. If you compare the methods of both in the API reference, you'll see that move() is present in infoWindow but not for popup.

This change is referenced in the "What's new" document:

http://help.arcgis.com/en/webapi/javascript/arcgis/jshelp/whats_new.html
0 Kudos
deleted-user-ATjHIWsdQYmT
Deactivated User
"The popup widget is now the default info window for the map."  Agreed.  It seems to be stylized that way.  But- all API still extensively documents the infoWindow as well as all of it's properties/methods/events.  http://developers.arcgis.com/en/javascript/jsapi/infowindow.html  If the infowindow were depreciated it would be documented as such.  Something isn't quite right here..
0 Kudos
KellyHutchins
Esri Notable Contributor
Steve,

The info window isn't deprecated and can still be used you'll just have to modify your app to do so. Here's a snippet showing how to do this:

      dojo.require("esri.dijit.InfoWindow");

.....
        var infoWindow = new esri.esri.dijit.InfoWindow({}, dojo.create("div", null, map.root));

        map.infoWindow.resize(625, 240);

        infoWindow.startup();
        map.setInfoWindow(infoWindow);
0 Kudos