|
POST
|
This is how it looks in your code:
<!DOCTYPE html>
<html>
<head>
<title>Create a Map</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="http://js.arcgis.com/3.11/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.11/esri/css/esri.css">
<style>
html, body, #mapDiv
{
padding:0;
margin:0;
height:100%;
}
</style>
<script src="http://js.arcgis.com/3.11/"></script>
<script>
var map;
require(["esri/map", "esri/layers/ArcGISTiledMapServiceLayer", "esri/layers/ArcGISDynamicMapServiceLayer",
"dojo/dom","dojo/on","dojo/parser","esri/geometry/Extent", "dojo/domReady!"], function (Map, Tiled, ArcGISDynamicMapServiceLayer,
dom, on,parser,Extent
) {
map = new Map("mapDiv", {
showAttribution: false,
sliderStyle: "large"
});
var tiled = new Tiled("http://maps.decaturil.gov/arcgis/rest/services/Aerial_2014_Tiled/MapServer");
map.addLayer(tiled);
var baseLayer = new ArcGISDynamicMapServiceLayer("http://maps.decaturil.gov/arcgis/rest/services/Base/MapServer");
var operationalLayer = new ArcGISDynamicMapServiceLayer("http://maps.decaturil.gov/arcgis/rest/services/Public/InternetVector/MapServer", { "opacity": 0.5 });
map.addLayer(baseLayer);
map.addLayer(operationalLayer);
map.on( "extent-change", showExtent);
function showExtent(extent) {
var s = "";
s = "XMin: "+ extent.extent.xmin.toFixed(2) + " "
+"YMin: " + extent.extent.ymin.toFixed(2) + " "
+"XMax: " + extent.extent.xmax.toFixed(2) + " "
+"YMax: " + extent.extent.ymax.toFixed(2);
dom.byId("info").innerHTML = s;
}
}
);
</script>
</head>
<body class="soria">
<div id="mapDiv">
<div id="extentDiv">
<div id="info" style="padding:5px; margin:5px; background-color:#eee;"></div>
</div>
</div>
</body>
</html>
... View more
11-07-2014
11:04 AM
|
1
|
0
|
1094
|
|
POST
|
Also use this line map.on("mouse-over", windowPop); So the function will run whenever your mouse is going over your map. Let me know if that fixes it.
... View more
11-07-2014
10:19 AM
|
0
|
4
|
2769
|
|
POST
|
Chris, here is an amd example of how to get extent: Edit fiddle - JSFiddle used this to set the extent: map-amd | API Reference | ArcGIS API for JavaScript Tim
... View more
11-07-2014
10:13 AM
|
1
|
0
|
1094
|
|
POST
|
Tracy, look at my last post here: https://community.esri.com/message/421034#421034 You can check if a part of the measurement widget is active: function windowPop(){ if (measurement.area.checked || measurement.distance.checked || measurement.location.checked){ map.setInfoWindowOnClick(false); } else { map.setInfoWindowOnClick(true); } } measurement.on("measure-end", function (){ map.setInfoWindowOnClick(true); }); Hope this helps! Tim
... View more
11-07-2014
08:24 AM
|
1
|
6
|
2769
|
|
POST
|
Hey Tracy, You could create a measurement checkbox and while the measurement checkbox is checked your identify task won't run. See the first couple of lines in my app. Full Mapping Application - JSFiddle
//Identify Task
on(registry.byId("identifyDiv"),"click", activateIdentify);
function activateIdentify(evt){
if (dijit.byId('identifyDiv').checked) {
identifyListener = map.on("click", executeIdentifyTask);
}
else {
identifyListener.remove();
}
}
Hope this helps! Tim
... View more
11-07-2014
07:42 AM
|
1
|
8
|
2769
|
|
POST
|
Ohh never mind, my example doesn't solve your issue. Let me see if I can post something else.
... View more
11-07-2014
06:21 AM
|
0
|
1
|
2547
|
|
POST
|
Chris, here is an example of 2 panes: ArcGIS API for JavaScript Sandbox Tim
... View more
11-07-2014
06:19 AM
|
0
|
0
|
2547
|
|
POST
|
I think you can't change it directly in your app, but there might be an IOs setting that lets you change it?
... View more
11-07-2014
05:50 AM
|
0
|
0
|
1456
|
|
POST
|
Russell, what application are you talking about? Tim
... View more
11-07-2014
05:19 AM
|
0
|
2
|
1456
|
|
POST
|
Try this: You were missing domReady and CheckBox in your function.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Practice for Java Script</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.11/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.11/esri/css/esri.css">
<script src="http://js.arcgis.com/3.11/"></script>
<script>
var map, basemp
require([
"esri/map",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/layers/ArcGISTiledMapServiceLayer",
"esri/dijit/Basemap",
"esri/dijit/BasemapToggle",
"esri/dijit/BasemapLayer",
"dojo/dom",
"dojo/on",
"dijit/form/CheckBox",
"dojo/query",
"esri/arcgis/utils",
"dojo/domReady!"
],
function (Map, ArcGISDynamicMapServiceLayer, ArcGISTiledMapServiceLayer, Basemap, BasemapToggle, BasemapLayer, dom, on,CheckBox, query, arcgisUtils) {
var checkBox;
map = new Map("map");
////Dynamic Map Srvices
var aGDM = new ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer");
var aOMAP = new ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Petroleum/KGS_OilGasFields_Kansas/MapServer");
////Tiled Map Services
var tstreet = new ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
var ttopo = new ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
var trelief = new ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer");
//// Using the basemap
// var bmLayer = new BasemapLayer({ url: "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyBasemap/MapServer" });
// var basempGDM = new Basemap({ layers: [bmLayer], title: "GDM", thumbnailUrl: "bm1.png" })
// map = new Map("map", { basemap: "GDM" });
var maps = [];
map.addLayer(aGDM);
maps.push(aGDM);
map.reorderLayer(aGDM, 0);
var linfos = [];
linfos = aGDM.layerInfos;
on(dom.byId("btnStreet"), "click", function () {
changeLayer(aGDM);
});
on(dom.byId("btnTopo"), "click", function () {
changeLayer(aOMAP);
});
function changeLayer(alname) {
map.removeLayer(maps[0]);
maps.length = 0;
map.addLayer(alname);
maps.push(alname);
map.reorderLayer(alname, 0);
getlayerId(alname);
// alert(map.getLayer(map.layerIds[0]).layerInfos[0].name);
}
function getlayerId(layerName) {
var layerInfos = layerName.layerInfos;
for (var i = 0, il = layerInfos.length; i < il; i++) {
var templayerName = layerInfos.name;
var layerId = layerInfos.id;
checkBox = new CheckBox({
name: "checkBox" + templayerName,
value: layerId
});
checkBox.on("change", function () {
var targetLayer = map.getLayer(this.value);
targetLayer.setVisibility(!targetLayer.visible);
this.checked = targetLayer.visible;
});
//alert(layerId);
}
}
});
</script>
</head>
<body>
This is the Practice of Java Script.... <br />
<div id="map" style="width:75%; height:500px; border:1px solid #000; float:left"></div>
<div id="dbtn" style="width:20%; float:right">
<button id="btnStreet" style="height:35px; width:80px" title="Switch Map Service">Street</button><br /><br />
<button id="btnTopo" style="height:35px; width:80px" title="Switch Map Service">Topo</button><br /><br />
</div><br />
<div id="Div1" style="width:20%; float:right">
<button id="Button1" style="height:35px; width:80px" title="Switch Map Service">Street</button><br /><br />
<button id="Button2" style="height:35px; width:80px" title="Switch Map Service">Topo</button><br /><br />
</div>
</body>
</html>
... View more
11-06-2014
05:52 AM
|
0
|
0
|
657
|
|
POST
|
Patrick, the javascript API has an example: ArcGIS API for JavaScript Sandbox Tim
... View more
11-05-2014
12:34 PM
|
0
|
2
|
4106
|
|
POST
|
Chris, your best bet is to just download the zipcode layer I have posted. There is no need to re-invent the wheel Tim
... View more
10-31-2014
10:36 AM
|
0
|
0
|
4225
|
|
POST
|
Chris, here is the thing. If you have lat/long on each zip, you will only be able to have a point layer. But from what I gather, you want a polygon layer that defines zipcode boundaries correct? If you just want the point layer to show a zipcode lable you can do the following. ArcGIS Desktop
... View more
10-31-2014
10:27 AM
|
0
|
2
|
4224
|
|
POST
|
For the US you can download zipcodes here: ftp://ftp2.census.gov/geo/tiger/TIGER2013/ZCTA5/tl_2013_us_zcta510.zip
... View more
10-31-2014
08:20 AM
|
0
|
4
|
4224
|
|
POST
|
Is there any spatial data within this spreadsheet? Lat/ Long?
... View more
10-31-2014
08:10 AM
|
0
|
6
|
4222
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-06-2015 06:58 AM | |
| 1 | 05-04-2016 07:27 AM | |
| 1 | 07-06-2017 08:12 AM | |
| 1 | 10-26-2015 11:51 AM | |
| 1 | 12-12-2014 12:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|