I'm trying to make a map using the Javascript API.
I want to use my own basemap, but I can't find the most simple code to do this.
I always see something like this:
function init() {
map = new esri.Map("mapDiv", {
basemap: "satellite",
center: [-97.395, 37.537],
zoom: 11
});
But I don't want to use the ArcGIS online basemaps.
What is the code to make a map service I am hosting my basemap?
Answer
The API Reference for the Map Class says the following:
The following are valid options: "streets" , "satellite" , "hybrid", "topo", "gray", "oceans", "national-geographic", "osm". As of version 3.3
You should instead, just define a new ArcGIS Tiled Map Service Layer and use it as follows:
var baseMapLayer = new esri.layers.ArcGISTiledMapServiceLayer("your URL");
map.addLayer(baseMapLayer);
No comments:
Post a Comment