Select to view content in your preferred language

How should I write html code to allow the webmap automatically zoom to layer?

2586
2
10-26-2015 03:20 AM
VladimirSopivnik
Deactivated User

Hello. I am working in a Petroleum company and I am not a professional website designer. I made a webmap in arcgis online for the company's website and paste the html code at the backstage of the website. It performs fine.

Now they have a requirement which is, they want to click a hyperlink on the website and the webmap on the same page will automatically zoom to a specific position. It should be an easy job, but I don't know how to write the html code. Can anybody help me? Thanks.

0 Kudos
2 Replies
BillChappell
Frequent Contributor

If you using ArcGIS.com have you considered bookmarks? You described what they do.

Bookmark places—ArcGIS Online Help | ArcGIS

If you were into JavaScript, you could replace the hyperlink with a button, and when it's clicked run a function, The function would change the map extents. aka bookmark.

0 Kudos
JakeSkinner
Esri Esteemed Contributor

HI Vladimir,

Take a look at the section 'Define extent' in the below link:

Use URL parameters—ArcGIS Online Help | ArcGIS

You can define the extent of the map directly in the URL.

0 Kudos