简体   繁体   中英

convert gps lat long to x,y coordinates in arcgis javascript api?

i am trying to build ambulance tracking application using arcgis maps. i want to convert gps lat long to xy coordinates because my maps are accept xy coordinates. i have tried with geometry service but it's to expensive task to ping server on each gps location receive. Is there any other way to convert lat long to xy? My base map spatial reference is 28600.

The only client-side coordinate conversion that is built in to the ArcGIS API for JavaScript is converting between longitude/latitude and Web Mercator (WKID 3857 or 102100). The webMercatorUtils class does those conversions client-side. For every other spatial reference, including 28600, you have to use a GeometryService .

proj4js will convert coordinate client side.

For example UTM 17 NAD83 to Lat / Long

var projSource = new Proj4js.Proj("EPSG:26917");
var projDest = new Proj4js.Proj("WGS84");
var pointSource = new Proj4js.Point("somenumber", "somenumber");
var pointDest = Proj4js.transform(projSource, projDest, pointSource);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM