Skip to content
ArcGIS Online (AGOL) Web Map using OpenLayers
JavaScript HTML CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

AGOL-OL: ArcGIS Online (AGOL) Web Map using OpenLayers

I wrote this JavaScript code to display one of my web maps hosted on ArcGIS Online (AGOL). I did not put much time and effort to polish this code, so it is just good enough to display this map and identify feature attributes.


createWebMap(mapDivId, itemId, extentLayerName);

HTML Example

    <title>ArcGIS Online (AGOL) Web Map using OpenLayers</title>
    <link rel="stylesheet" href="" type="text/css">
    <link rel="stylesheet" href="agol-ol.css" type="text/css">
    <script src="" type="text/javascript"></script>
    <script src="agol-ol.js" type="text/javascript"></script>
    <div id="map" class="map"></div>
    <script type="text/javascript">
      // create a web map
        // div ID for the map
        // portal item ID of my web map
        // extent layer name


Copyright (C) 2017, Huidae Cho

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see

You can’t perform that action at this time.