AnsweredAssumed Answered

converting between projections for zooming to layer extents

Question asked by TRRP on May 24, 2017
Latest reply on May 25, 2017 by TRRP

As it exists, I'm using a batch of ImageServer and MapServer data in California state plane, while my view is using web mercator. I'd like to use some 'zoom to extent' actions.  Simply updating the view extent with the layer extents sends me off to odd parts of the world.  So apparently any reproject on the fly works for the services, but not when transferring extents - the spatialReference property seems to have no effect.  Tried both:

view.extent = featureLayer.fullExtent;

view.goTo(featureLayer.fullExtent);

So, I'm looking into projecting the xmin... values from my state plane layers into web mercator and using them to set the view extent.  I've constructed a point with state plane for the spatialReference, and checked it with

webMercatorUtils.canProject(myPoint, map);

but that returns false.  So I'm presuming that the arcgis api just can't project from state plane to web mercator?  Is there a list of projections that are functional?

 

Alternatively, do I just need to give up on going in this direction and get all my ImageServer and MapServer data projected to web mercator to start with?

 

Thanks!

Outcomes