GEOG 260
Mapping Our Changing World

1.2.1 Embedding a Map

PrintPrint

While it's sometimes preferable to share the link to your map -- allowing it to fill the viewer's browser window -- it can also be useful to embed the map within a page of content. 

  1. Save this example page to your computer.  (Right-click on the link and choose Save.)
     
  2. Open the page in a plain text editor of your choosing (e.g., Notepad).
     
  3. If your ArcGIS Online map is no longer open, go to our Penn State organization page, click the Content tab, click on the map you created earlier, then select Open > Open in map viewer.
     
  4. Click Share, then EMBED IN WEBSITE.
    Opening the dialog for embedding a map on a website
    Note that ArcGIS Online provides a number of options for customizing the embedded map.  For example, it's possible to specify the dimensions of the map, and to include widgets such as a base map selector or legend. 
     
  5. After making settings to your liking, find the wide text box just above the Map Options.  This box contains the HTML code required to embed your map within a web page.  Click the COPY button to the right of that text box to copy the HTML code to your machine's clipboard.
    Copying the code for embedding a map in a website
     
  6. Paste that code into your HTML document just beneath the My ArcGIS Online Map heading.  Double-check the URL to your map.  If it doesn't include the http: protocol, you will need to add it in front of //pennstategis.maps.arcgis.com in the html code for your map to connect properly.
    Pasting code to embed a map in a website
     
  7. Save your HTML document with a name like lesson1.html.
     
  8. Using the File Explorer in Windows, browse to the document you just saved and double-click on it to open it in a web browser.  (If .html files aren't set to open in a web browser on your machine, you may need to right-click and select Open With.)