functionzoomToBBox(bottomLeftCorner,topRightCorner,callback,errback){// transform sample points to current CRSgsp.crs.transform({points:[bottomLeftCorner,topRightCorner],sourceCrsId:"EPSG:4326",targetCrsId:gsp.crs.getCurrent()},function(transformationResult){// get BBOX in form minx, miny, maxx, maxyvarpoints=transformationResult.points,bbox=[points[0].x,points[0].y,points[1].x,points[1].y];gsp.map.zoom({bbox:bbox});});}// example usagezoomToBBox({x:-179.9999,y:-89.9999},{x:179.9999,y:89.9999});
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.