how to use map created via ArcGIS and stored in MY CONTENT

588
3
02-03-2011 02:59 AM
rupalipardeshi
New Contributor
hii i am creating a website in which i need a "ONLY" Scotland map , i have created one via ArcGIS.com and it got stored in "My content", i have to make changes in my URL to refer this map
var basemap = new esri.layers.ArcGISTiledMapServiceLayer(URL)
but i not not working.
Actually am not getting from where to get the correct reference to the map created by me.
plz help me in what to do so that i can get to required map in my web page
pls
0 Kudos
3 Replies
KellyHutchins
Esri Frequent Contributor
You can use the esri.arcgis.utils.createMap method to add an item from ArcGIS.com to your application. This method requires the web map id from ArcGIS.com. There are a few samples in the help that show how to work with items from ArcGIS.com

http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/ags_fullmaplay...
0 Kudos
rupalipardeshi
New Contributor
Thank u sir for your reply, actually am a student am new to this....
i saw samples and the live projects as well, map id is mentioned over there , but am not able to find that id as well, i checked out the description of the map ,its not there:( and i saw a video in help about "how to use the map created in the web  site" it say while shearing the map there the option for using it in web site and then HTML code we have to copy and paste in over web page but i not think its proper choice to do, kindly tell me from where to get the map id...
0 Kudos
JaclynGorman
New Contributor
The map id usually refers to the variable used when creating the map application. Within this "map" you have the layers and geoprocessing events. Below is an example:


      [PHP]var map; //Your initial variable calling the map
      function init() {
        var initExtent = new esri.geometry.Extent({"xmin":-17731,"ymin":6710077,"xmax":-12495,"ymax":6712279,"spatialReference":{"wkid":102100}});
        map = new esri.Map("map",{extent:initExtent});
        //Add the world street map layer to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service   
        var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
        map.addLayer(basemap); 
        //resize the map when the browser resizes - view the 'Resizing and repositioning the map' section in
        //the following help topic for more details http://help.esri.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_guidelines.htm
        var resizeTimer;
        dojo.connect(map, 'onLoad', function(theMap) {
          dojo.connect(dijit.byId('map'), 'resize', function() {  //resize the map if the div is resized
            clearTimeout(resizeTimer);
            resizeTimer = setTimeout( function() {
              map.resize();
              map.reposition();
            }, 500);
          });
        });
      }
      dojo.addOnLoad(init);
    </script>
  </head>
 
  <body class="claro">
    <div dojotype="dijit.layout.BorderContainer" design="headline" gutters="false"
    style="width: 100%; height: 100%; margin: 0;">
//This inserts the map into the body of your webpage    
<div id="map" dojotype="dijit.layout.ContentPane" region="center" style="overflow:hidden;">
      </div>
    </div>
  </body>

</html>[/PHP]

So your ID is what you are calling your map when you load it into the webpage.  Hope this helps

Jaclyn
0 Kudos