require(["esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/layers/ImageParameters", "esri/dijit/BasemapLayer", "esri/dijit/Basemap", "esri/dijit/OverviewMap", "esri/geometry/webMercatorUtils", "dojo/parser", "dijit/registry", "dijit/Toolbar", "esri/toolbars/navigation", "esri/toolbars/draw", "esri/graphic", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/Color", "dijit/form/Button", "dojo/on", "dojo/dom", "dojo/domReady!"], function (Map, ArcGISDynamicMapServiceLayer, ImageParameters, BasemapLayer, Basemap, OverviewMap, webMercatorUtils, parser, registry, Navigation, Draw, Graphic, SimpleFillSymbol, SimpleLineSymbol, Color, on, dom) {
require([
"esri/map",
"esri/layers/ArcGISDynamicMapServiceLayer",
dojo.parser.parse();"esri/layers/ImageParameters",
"esri/dijit/BasemapLayer",
"esri/dijit/Basemap",
"esri/dijit/OverviewMap",
Get a reference to"esri/geometry/webMercatorUtils",
the ArcGIS Map class"dojo/parser",
"dijit/registry",
"dijit/Toolbar",
var firstBasemapLayer ="esri/toolbars/navigation",
new esri.dijit.BasemapLayer({ "esri/toolbars/draw",
"esri/graphic",
"esri/symbols/SimpleFillSymbol",
url:"http:/"esri/services.arcgisonline.comsymbols/ArcGISSimpleLineSymbol",
"esri/restColor",
"dijit/servicesform/World_Topo_MapButton",
"dojo/MapServer"on",
"dojo/dom",
"dojo/domReady!"
],
});function(Map,
ArcGISDynamicMapServiceLayer,
ImageParameters,
varBasemapLayer,
firstBasemap = new esri.dijit.Basemap({,
OverviewMap,
webMercatorUtils,
id:"Basemap1"parser,
registry,
Navigation,
layers:[firstBasemapLayer]Draw,
Graphic,
SimpleFillSymbol,
opacity:0.8SimpleLineSymbol,
Color,
on,
title:"World topodom) Map"{
});
var secondBasemapLayer = new esridojo.dijitparser.BasemapLayerparse({
url:"http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer"
});
var secondBasemap = new esri.dijit.Basemap({
id:"Basemap2",
layers:[secondBasemapLayer],
opacity:0.8,
title:"oceans"
});
// Get a reference to the ArcGIS Map class
var thirdBasemapLayerfirstBasemapLayer = new esri.dijit.BasemapLayer({
url: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_MapWorld_Topo_Map/MapServer"
});
var thirdBasemapfirstBasemap = new esri.dijit.Basemap({
id:"Basemap3" "Basemap1",
layers:[thirdBasemapLayer] [firstBasemapLayer],
opacity: 0.8,
title: "World topo title:"streets"Map"
});
// Get a reference to the ArcGIS Map class
map = new Map("map");
map.setBasemap(firstBasemap);
on(dom.byId("radiobasemap1"), "change", updateBaseMap);
var secondBasemapLayer = new on(domesri.byId("radiobasemap2"), "change", updateBaseMap);
on(domdijit.byId("radiobasemap3"), "change", updateBaseMap);
function updateBaseMapBasemapLayer(){
debugger;
url: if(dojo.byId("radiobasemap1")"http://services.checked){
maparcgisonline.setBasemap(firstBasemap);
com/ArcGIS/rest/services/Ocean_Basemap/MapServer"
}
if(dojo.byId("radiobasemap2").checked){
map.setBasemap(secondBasemap);
}
var secondBasemap = new if(dojo.byId("radiobasemap3")esri.checked){
mapdijit.setBasemapBasemap(thirdBasemap);{
id: "Basemap2",
layers: }[secondBasemapLayer],
}
opacity: 0.8,
title: "oceans"
});
var thirdBasemapLayer = new //Getesri.dijit.BasemapLayer({
supported image Parameters url: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
});
var imageParametersthirdBasemap = new ImageParametersesri.dijit.Basemap();{
id: "Basemap3",
imageParameters.format = "PNG"; //set the imagelayers: type[thirdBasemapLayer],
to PNG24, note default is PNG8opacity: 0.8,
title: "streets"
});
// Get a reference to the ArcGIS Map class
var dynamicMap map = new ArcGISDynamicMapServiceLayerMap("http://iicss63:6080/arcgis/rest/services/NCAOR_Prasad/WorldShape_Prasad/MapServer", {"map");
map.setBasemap(firstBasemap);
on(dom.byId("radiobasemap1"), "change", updateBaseMap);
"opacity": 0on(dom.5byId("radiobasemap2"),
"change", updateBaseMap);
on(dom.byId("radiobasemap3"), "change", updateBaseMap);
"imageParameters":function imageParametersupdateBaseMap() {
debugger;
if (dojo.byId("radiobasemap1").checked) {
map.setBasemap(firstBasemap);
}
}if (dojo.byId("radiobasemap2");.checked) {
map.addLayersetBasemap(dynamicMapsecondBasemap);
}
if map.on("load", function dojo.byId("radiobasemap3").checked) {
map.setBasemap(thirdBasemap);
}
}
//afterGet mapsupported loads,image connectParameters
to listen to mousevar moveimageParameters &= dragnew eventsImageParameters();
imageParameters.format = "PNG"; //set the mapimage type to PNG24, note default is PNG8.on
var dynamicMap = new ArcGISDynamicMapServiceLayer("mouse-move""http://iicss63:6080/arcgis/rest/services/NCAOR_Prasad/WorldShape_Prasad/MapServer", showCoordinates);{
"opacity": map0.on("mouse-drag"5,
showCoordinates); "imageParameters": imageParameters
});
map.addLayer(dynamicMap);
map.on("load", function() {
//after map loads, connect to listen to mouse move & drag events
map.on("mouse-move", showCoordinates);
map.on("mouse-drag", showCoordinates);
});
function showCoordinates(evt) {
// the map is in web mercator but display coordinates in geographic (lat, long)
//display Map coordinates
}
//Display overview Map
var overviewMapDijit = new esri.dijit.OverviewMap(
{map: map,
attachTo: "bottom-right",
visible: true
},
//Display overview Map
var overviewMapDijit = dojonew esri.byIddijit.OverviewMap("overviewMapDiv"));{
map: map,
overviewMapDijit.startup(); attachTo: "bottom-right",
visible: true
},
dojo.byId("overviewMapDiv"));
overviewMapDijit.startup();
//create draw toolbar
drawToolbar=new esri.toolbars.Draw(map);
//Create graphic and fill color to graphic
var symbol = new SimpleFillSymbol();
//create draw toolbar
drawToolbar = new esri.ontoolbars.Draw("draw-end", addToMapmap);
//addCreate graphic to map
function addToMap(evt) {
and fill color to graphic debugger;
var graphicsymbol = new Graphic(evt.geometry, symbol);
map.graphics.addSimpleFillSymbol(graphic);
}
//navigation toolbar
navToolbar = new esri.toolbars.Navigation(map);
// var registrytools=dojo.digit.registry;
on(navToolbar, "onExtentHistoryChange", extentHistoryChangeHandler);
registry.byId("zoomin")drawToolbar.on("click""draw-end", function () {
drawToolbar.deactivate();
navToolbar.activate(esri.toolbars.Navigation.ZOOM_IN);
}addToMap);
//add graphic to map
registry.byId("zoomout").on("click", function addToMap(evt) {
debugger;
drawToolbar.deactivate();
var graphic = new Graphic(evt.geometry, symbol);
navToolbar.activate(esri.toolbarsmap.Navigationgraphics.ZOOM_OUTadd(graphic);
});
registry.byId("zoomfullext").on("click", function () {
drawToolbar.deactivate();
navToolbar.zoomToFullExtent();
//navigation });toolbar
navToolbar = new registry.byId("zoomprev")esri.on("click", function () {
drawToolbartoolbars.deactivateNavigation(map);
// var navToolbarregistrytools=dojo.zoomToPrevExtent();digit.registry;
on(navToolbar, "onExtentHistoryChange", }extentHistoryChangeHandler);
registry.byId("zoomnext""zoomin").on("click", function () {
drawToolbar.deactivate();
navToolbar.zoomToNextExtentactivate(esri.toolbars.Navigation.ZOOM_IN);
});
registry.byId("pan""zoomout").on("click", function () {
drawToolbar.deactivate();
navToolbar.activate(esri.toolbars.Navigation.PANZOOM_OUT);
});
registry.byId("deactivate""zoomfullext").on("click", function () {
drawToolbar.deactivate();
navToolbar.zoomToFullExtent();
navToolbar.deactivate(});
});
registry.byId("drawRectangle""zoomprev").on("click", function () {
navToolbardrawToolbar.deactivate();
navToolbar.zoomToPrevExtent();
drawToolbar.activate(esri.toolbars.Draw.RECTANGLE});
}registry.byId("zoomnext");
.on("click", function extentHistoryChangeHandler() {
drawToolbar.deactivate();
navToolbar.zoomToNextExtent();
});
registry.byId("zoomprev""pan").disabled =on("click", navToolbar.isFirstExtentfunction(); {
drawToolbar.deactivate();
registrynavToolbar.byIdactivate("zoomnext")esri.disabled = navToolbartoolbars.isLastExtent(Navigation.PAN);
});
registry.byId("deactivate").on("click", function() {
drawToolbar.deactivate();
navToolbar.deactivate();
});
registry.byId("drawRectangle").on("click", function() {
navToolbar.deactivate();
drawToolbar.activate(esri.toolbars.Draw.RECTANGLE);
});
function extentHistoryChangeHandler() {
registry.byId("zoomprev").disabled = navToolbar.isFirstExtent();
registry.byId("zoomnext").disabled = navToolbar.isLastExtent();
}
});