ArcGIS for Javascriptapi Common interface __arcgis
Source: Internet
Author: User
var map, Navtoolbar, Edittoolbar, Tilelayer, toolbar;
var mapbaseurl = "Http://localhost:8399/arcgis/rest/services/pdsTile/MapServer";
var mapdyurl = "Http://localhost:8399/arcgis/rest/services/pds/MapServer";
var mapdyurl = "Http://10.19.110.130:8080/arcgis/rest/services/BaseMAP/MapServer";
var mapdyurl = "Http://10.19.110.130:8080/arcgis/rest/services/baseMAP/MapServer";
var mapbjurl = "Http://10.19.110.130:8080/arcgis/rest/services/YCBJ/MapServer";
var dynamicmapservicelayerbj;
function init () {
try{
Map = new ESRI. Map ("map");
Tilelayer = new Esri.layers.ArcGISTiledMapServiceLayer (Mapbaseurl);
Map.addlayer (Tilelayer);
var dynamicmapservicelayer = new Esri.layers.ArcGISDynamicMapServiceLayer (Mapdyurl);
Map.addlayer (Dynamicmapservicelayer);
DYNAMICMAPSERVICELAYERBJ = new Esri.layers.ArcGISDynamicMapServiceLayer (Mapbjurl);
Map.addlayer (DYNAMICMAPSERVICELAYERBJ);
try{
Display all layer names in the dropdown box
var layers = Dynamicmapservicelayerbj.layerinfos;
var obj1 = new Option ("",-1);
for (var i=0; i<layers.length; i++) {
var obj = new Option (layers[i].name, i);
Dojo.byid ("layers"). Add (obj);
}
}catch (e) {
alert (e.message);
}
}
Locate Street View
function Zoomto3d (EVT)
{
var point = Evt.mappoint;
var x = point.x.tofixed (4);
var y = point.y.tofixed (4);
Window.top.addmark (x, y);
Alert (x + ' | ' + y);
Locate Street View
Locationtruemap (x, y);
}
Load Street View based on coordinates
function Locationtruemap (x, y) {
window.top.frames["Mapframe"].frames["Ldframe"].showvisionbylnglat (x, y); Navigate to the Street View
}
Eagle Eye Chart
function Showoverview () {
var layer = new Esri.layers.ArcGISDynamicMapServiceLayer (Mapdyurl);
Layer.setimageformat ("Png24");
try{
var createoverviewmap = function () {
Overviewmapdijit = new Dijits.overview.OverviewMap ({
Map:map,
Baselayer:layer,
width:150,
height:150,
Attachto: "Bottom-right",
expandfactor:1.42,
Color: "#80A8C1",
opacity:0.5
});
Overviewmapdijit.startup ();
};
}catch (e) {
Alert ("Failed to load Eagle Eye Chart:" +e.message);
}
Function del (ID, x, y) {
Alert (x + "--" + y);
Window.parent.showdialog (' del ', id, x, y);
}
function Addpoint (evt) {
try{
var symbol = new Esri.symbol.PictureMarkerSymbol (' Images/nav/bz.png ', 25, 25);
var point = new Esri.geometry.Point (evt.mappoint, New ESRI. Spatialreference ({wkid:4326}));
var graphic = new Esri. Graphic (point, symbol);
Map.graphics.add (graphic);
window.top.frames["Mapframe"].frames["Ldframe"].showvisionbylnglat (geopt.x.tofixed (4), geoPt.y.toFixed (4)); Navigate to the Street View
}catch (e) {
Alert ("Add callout Error:" +e.message);
}
}
Positioning
function Zoomtopoint (x, y) {
var geopoint = new Esri.geometry.Point ({"X": X, "Y": y}, Map.spatialreference);
Map.centerandzoom (Geopoint, 3);
}
Car positioning
Zoomcar (113.32,23.12);
function Zoomcar (x, y) {
Navtoolbar.deactivate ();
Map.graphics.clear ();
try{
var geopoint = new Esri.geometry.Point ({"X": X, "Y": y}, Map.spatialreference);
Map.centerandzoom (Geopoint);
var symbol = new Esri.symbol.PictureMarkerSymbol (' Images/nav/car.png ', 24,24);
var graphic = new Esri. Graphic (geopoint, symbol);
Map.graphics.add (graphic);
}catch (e) {
Alert ("Car positioning" + e.message);
}
}
var url = "http://192.168.1.11:8080";
Receive subject name, coordinate value
function getbz (AA) {
var graphicslayer = new Esri.layers.GraphicsLayer ();
try {
for (var i = 0; i < aa.length; i++) {
a_x = aa[i][1];
a_y = aa[i][2];
Alert (a_x+ "---" +a_y);
var point = new Esri.geometry.Point (a_x, a_y, map.spatialreference);
var symbol = new Esri.symbol.PictureMarkerSymbol (' Images/nav/bz.png ', 25, 25);
var textsym = new Esri.symbol.TextSymbol (aa[i][0]);
Textsym.setalign (Esri.symbol.TextSymbol.ALIGN_END);
var graphic = new Esri. Graphic (point, symbol);
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.