Looked over the example can NOT figure out how to set basemap MANUALLY. I don't want a dijit widget, or any other libraries or anything like that. Just want to manually set a basemap to any of the already available types like Topographic, Satellites, Streets, etc. My script code so far is like this.
The part I can't figure out is marked with question marks.
require([
"esri/basemaps",
"esri/map",
"dojo/domReady!"
], function (esriBasemaps, Map) {
/* ------------------------------------- */
/* Basemap add one of the existing maps. */
/* ------------------------------------- */
esriBasemaps.myBasemap = {
baseMapLayers ???
};
var map = new Map("map", {
basemap: "myBasemap",
center: [-118, 34.5],
zoom: 8
});
});
Best Answer
From the documentation javascript api:
basemap Optional Specify a basemap for the map. The following are valid options: "streets" , "satellite" , "hybrid", "topo", "gray", "dark-gray", "oceans", "national-geographic", "terrain" and "osm". Property added at v3.3. The "terrain" and "dark-gray" options added at v3.12.
You only need to put in the code the name of the basemap:
var map = new Map("map", {
basemap: "streets|satellite|hybrid|etc..",
center: [-118, 34.5],
zoom: 8
});