Can you please let me know how we can enable ArcGIS JavaScript API to use custom ZoomIn function?
For example let's say I have a code Like
<button id="zoom-to-point" > Zoom To </button>
and in Js Part
$("#zoom-to-point").on('click', function(){
var zoomLat = 49.2898
var zoomLong = -123.1364;
map.zoomTo(zoomLat,zoomLong );
});
As you know we have not such a .zoomTo function in API so can you please let me know how can I get it done?
Solved! Go to Solution.
Behrouz,
location is a point class. So you just create a point class and pass it to the centerAndZoom method.
Thanks Robert,
so how can I pass the
var zoomLat = 49.2898
var zoomLong = -123.1364;
to location in :
map.centerAndZoom(location,12);
Thanks again
Behrouz,
location is a point class. So you just create a point class and pass it to the centerAndZoom method.
Thanks Robert
I Tried this and it is working, but not sure if it is the best way to do?
var location = new Point(zoomLong,zoomLat);
map.centerAndZoom(location,16);
can you please let me know if there is a better way to do this?
What version of the API are you using?
Hi Evon,
Thanks for reply, I am using 3.19