Select to view content in your preferred language

Center a web map

922
3
02-10-2017 11:40 AM
JohnGessford
Deactivated User

I'm new to all this, created a web map, can see it on a web page by using copying sample code.  Can I re-center my web map by setting the [center] value in the config options.  I tried below but it seems to be ignored.

configOptions = {
 webmap: "eaab774a02b94ca6b8d8981c01652e6e",
 title: "",
 subtitle: "",
 //www.arcgis.com sharing url is used. modify this if yours is different
 sharingurl: "https://www.arcgis.com/sharing/rest/content/items",
 center: [-117.895287, 33.745709]
 };
0 Kudos
3 Replies
RickeyFight
MVP Regular Contributor

Have you tried re-centering the webmap that it is pulling from? 

0 Kudos
JohnGessford
Deactivated User

I need to change it dynamically, I'll be presenting this map for many different addresses.  I know I can do this on a Basic map, but I need to overlay demographics data on the map and the only way I can see to do that is with a pre-defined web map. 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

John,

   A web map get set to a JS API map object so just use map.centerAt(your map point);