Actually I am trying to recenter a map with a longitude and latitude from text boxes with widget in web app builder.
Can anybody help me out ?
Solved! Go to Solution.
Hi Saurabh!
This is easy to do...you just need to use
map.centerAt(mapPoint);
Here's the Reference:
Map | API Reference | ArcGIS API for JavaScript
You have to setup a new Point Geometry
var point = new Point([x,y],new SpatialReference({ wkid:XXXXX }));
with your Koordinates and use this Point to recenter the Map.
Regards
Hi Saurabh!
This is easy to do...you just need to use
map.centerAt(mapPoint);
Here's the Reference:
Map | API Reference | ArcGIS API for JavaScript
You have to setup a new Point Geometry
var point = new Point([x,y],new SpatialReference({ wkid:XXXXX }));
with your Koordinates and use this Point to recenter the Map.
Regards
Thanks Miriam for your response.
Can you please share the code because I need to use this javascript code in web app builder to create a widget. My doubt is where to write this code either in widget.js file or in widget.html file.@
I'm not familiar with the web app builder, but i think because it's javascript I
would place it in widget.js. This file is loaded at the start and so your code available
when you need it.
Thanks a lot Miriam....