Select to view content in your preferred language

zoomTo button in infoTemplate map is blank

898
3
Jump to solution
06-26-2014 07:23 AM
TracySchloss
Honored Contributor
I am using an infoTemplate to show attributes and have it defined in the map definition with an infoWindow as a popup so that each has the small ZoomTo link at the bottom.  I'm not sure what is going on behind the scenes with the ZoomTo, but that has always worked just fine for me, with either points, lines or polygons.
 var popup = new Popup({         fillSymbol: highlightFillSymbol       }, domConstruct.create("div"));       map = new Map("mapDiv", {         infoWindow: popup,         basemap: "streets",         center: [-92.593, 38.5],         zoom: 7       });        infoTemplate = new InfoTemplate();       infoTemplate.setTitle("<b>${NAME}</b>");       

This particular project uses ZIP boundaries, which are more complex than some polygons and for whatever reason, which I click the Zoom To, instead of zooming to the polygon, the map is just blank.  My layer is set wkid 102100, the same as my basemap.  I don't know if it is zooming in past some scale threshold for this particular layer.  I'm not sure why it would be doing that.  It doesn't show either my layers or the ESRI basemap. 

I have used this exact same settings for county boundaries and it works just fine.  There's nothing in my code that is doing the ZoomTo, just the built in functionality with having a popup as part of your infoWindow definition. 

I don't have any minimum zoom thresholds set on my service.
0 Kudos
1 Solution

Accepted Solutions
StevenGraf1
Frequent Contributor
Have you recently upgraded to 10.2.2?

A bug has been reported with the Zoom To.

A workaround is linked at the bottom of this post here

View solution in original post

0 Kudos
3 Replies
StevenGraf1
Frequent Contributor
Have you recently upgraded to 10.2.2?

A bug has been reported with the Zoom To.

A workaround is linked at the bottom of this post here
0 Kudos
TracySchloss
Honored Contributor
Yes I have.  That explains it!  You'd think I would have noticed that behavior in my other code, but I'm still in the process of getting services going and rewriting some of my older code.

That's rather a glaring problem, I'm sure to get complaints from the users.  It's worked in many other past versions!!!!
0 Kudos
TracySchloss
Honored Contributor
This was the return from an IdentifyTask, so I added the suggested line into my result handler:

        feature.geometry.spatialReference = map.spatialReference;
0 Kudos