AnsweredAssumed Answered

Convert GPS coordinates to custom wkid

Question asked by oscar.monellesri-se-esridist Employee on Mar 6, 2012
Latest reply on Apr 13, 2012 by DublinOhio
We are trying to use GPS location in a map with services in wkid 3008 using this code:
     if (navigator.geolocation){          navigator.geolocation.getCurrentPosition(zoomToLocation, locationError);           } 

    function zoomToLocation(location) {         var pt = new esri.geometry.Point(location.coords.longitude, location.coords.latitude);                   var outSR = new esri.SpatialReference({ wkid: 3008});        gsvc.project([ pt ], outSR, function(projectedPoints) {         pt = projectedPoints[0];         map.centerAndZoom(pt, 8);        }); }


But we don't get the expected result, map loads fine but when using position maps zooms in to a out of bounds location.
What are we missing?

Outcomes