javascript - ArcGIS initial map location jsapi -


i trying use customers arcgis system render map on page using arcgis javascript api.

to define map in examples displays:

map = new map("map",{           basemap: "topo",           center: [-117.19,34.05], // lon, lat           zoom: 13         }); 

however showing fixed co-ordinates.

i want able hit restapi in customers internal system land id , return , plot co-ordinates.

currently retrieving degree minute second latitude , longitude land wondering if there simpler way having these values string, split them degrees minutes seconds , making calculation x,y values plot function define map.

essentially trying load map in location specified land id , after load map layers on top, through the local systems restapi , javascript api.

thanks,

this spatial reference(i.e 102100, 4326 etc) of map. whatever add above snippet code add map basemap (topology) , center of map co-ordinates have provided.

if want add point map , has different format of geometry can use project geometry operation convert.

require([   "esri/tasks/projectparameters", ...  ], function(projectparameters, ... ) {   var params = new projectparameters();   params.geometries = [point];   params.outsr = outsr;   params.transformation = transformation;   gsvc.project(params);   ... }); 

for reference: https://developers.arcgis.com/javascript/jsapi/geometryservice-amd.html#project

convert degree minute second decimal/lat long:

function convertdegreeangletodecimal(degrees, minutes, seconds ) {     //decimal degrees =      //   whole number of degrees,      //   plus minutes divided 60,      //   plus seconds divided 3600      return degrees + (minutes/60) + (seconds/3600); } 

hope you.

let me know if need more clarifications!


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -