AnsweredAssumed Answered

Inconsistent Map Centering After Geocode Result Returned

Question asked by sethlewistempe on Oct 20, 2015
Latest reply on Oct 22, 2015 by sethlewistempe

Our app returns a graphic point based on an address search. And we've encountered inconsistent behavior when it comes to the map centering on results.

 

Some addresses will return the graphic pt placed in the center of the map as intended:

slt_center_map.PNG

 

While other addresses will return the graphic pt in the top left or right of the resulting extent:

slt_offright_map.PNG

And other address searches will center the map on an area where the graphic point isn't showing at all (though it's still returned to the map as evidenced by the user zooming out or panning).

 

After the graphic pt is called we have our zoom function:

function zoomToPlaces(places) {
                  var multiPoint = new Multipoint(map.spatialReference);
                  for (var i = 0; i < places.length; i++) {
                      //multiPoint.addPoint(places[i].location);
                      multiPoint.addPoint(places[i].feature.geometry);
                  }
                  map.setExtent(multiPoint.getExtent().expand(2.0));
              }

Would having the expand factor set at 2 be a possible cause of this behavior? Has anyone encountered this issue before?

 

Message was edited by: Seth Lewis

Outcomes