Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've got a website where I'd like to insert maps with some placemarks (restaurants, points of interest, ...). I'm tired of Google Maps and like to use ESRI basemaps. Is it possible to do this?

I'd like to create these maps directly from my webpages (with JavaScript) and without embeding ArcGIS online maps (I suppose this would require to create the map in 'arcgis.com' before).

Is it possible with any ESRI JavaScript API? Thank you very much.

share|improve this question
add comment

1 Answer 1

Possible with the ESRI JavaScript API

Note you will need to know the map id in this example it is '5b9675ca7ca9426a99ced88f66b42331'

var mapDeferred = esri.arcgis.utils.createMap("5b9675ca7ca9426a99ced88f66b42331", "map"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Topographic Map

<style>
  html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
  .esriScalebar{
    padding: 20px 20px;
  }
  #map{
    padding:0;
  }
</style>
<script type="text/javascript">var djConfig = {parseOnLoad: true};</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2"></script>
<script type="text/javascript">
  dojo.require("dijit.layout.BorderContainer");
  dojo.require("dijit.layout.ContentPane");
  dojo.require("esri.map");
  dojo.require("esri.arcgis.utils");

  var map;

  function init() {
    var mapDeferred = esri.arcgis.utils.createMap("5b9675ca7ca9426a99ced88f66b42331", "map", {
        mapOptions: {
          slider: true,
          nav:false,
          wrapAround180:true
        }
      });
      mapDeferred.then(function(response){
        map = response.map;

        dojo.connect(dijit.byId('map'), 'resize', map,map.resize);
      });
  }

  dojo.addOnLoad(init);
</script>

http://help.arcgis.com/en/webapi/javascript/arcgis/samples/map_main/index.html

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.