POST
|
Does the zoom in and zoom out have a seperate disable code? Something like map.disablezoomoutNav()?
... View more
07-26-2011
09:40 AM
|
0
|
0
|
269
|
POST
|
I have this code in my html, if I select a zoom in button and then select the "select" button it will not disable the map navigation. <button dojoType="dijit.form.Button" onClick="selectionToolbar.activate (esri.toolbars.Draw.FREEHAND_POLYGON);map.disableMapNavigation();resetSums();">Select</button> that is all i need right? Thanks Timothy
... View more
07-20-2011
07:57 AM
|
0
|
2
|
1288
|
POST
|
I want to be able to turn on and off the labels to a layer. I currently have a Parcels layer that is coming in as a feature layer and a label layer (msd with only the labels turned on) coming in as a dynamic layer. from my preliminary research, it seems that I can not get the dynamic layer to be "above" the feature layer. Is that correct? I also could not find a good example on how to toggle labels for feature layers. Any suggestions? What are my options? I have searched the forums but there is little on labels. I can't be the only one who wants labels on their maps. Thanks Timothy
... View more
07-17-2011
12:34 PM
|
0
|
4
|
585
|
POST
|
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/widget/widget_legendvisible.html I saw this example and wanted to see if there was a way to have the check box not checked(dynampic map not visible) when the page was loaded. For example not have the "Fire" layer visible when the page was loaded. Thanks <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<!--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>Updating the legend to display visible layers</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.3/js/dojo/dijit/themes/claro/claro.css">
<style>
html, body { height: 98%; width: 98%; margin: 0; padding: 5px; }
#rightPane{
width:20%;
}
#legendPane{
border: solid #97DCF2 1px;
}
</style>
<script type="text/javascript">var djConfig = {parseOnLoad: true};</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.3"></script>
<script type="text/javascript">
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.AccordionContainer");
dojo.require("esri.map");
dojo.require("esri.dijit.Legend");
dojo.require("esri.arcgis.utils");
dojo.require("dijit.form.CheckBox");
var map;
var legendLayers = [];
function init() {
var initialExtent = new esri.geometry.Extent({"xmin":-13133288,"ymin":4020012,"xmax":-13016186,"ymax":4090945,"spatialReference":{"wkid":102100}});
map = new esri.Map("map", { extent: initialExtent});
//Add the terrain service to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
map.addLayer(basemap);
var quakeLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer",{id:'quakes'});
legendLayers.push({layer:quakeLayer,title:'Earthquakes'});
var fireLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/MapServer",{id:'fire'});
legendLayers.push({layer:fireLayer,title:"Fire"});
dojo.connect(map,'onLayersAddResult',function(results){
var legend = new esri.dijit.Legend({
map:map,
layerInfos:legendLayers
},"legendDiv");
legend.startup();
});
map.addLayers([fireLayer,quakeLayer]);
dojo.connect(map,'onLayersAddResult',function(results){
//add check boxes
dojo.forEach(legendLayers,function(layer){
var layerName = layer.title;
var checkBox = new dijit.form.CheckBox({
name: "checkBox" + layer.layer.id,
value: layer.layer.id,
checked: layer.layer.visible,
onChange: function(evt) {
var clayer = map.getLayer(this.value);
if (clayer.visible) {
clayer.hide();
} else {
clayer.show();
}
this.checked = clayer.visible;
}
});
//add the check box and label to the toc
dojo.place(checkBox.domNode,dojo.byId("toggle"),"after");
var checkLabel = dojo.create('label',{'for':checkBox.name, innerHTML:layerName},checkBox.domNode,"after");
dojo.place("<br />",checkLabel,"after");
});
});
//resize the map when the browser resizes - view the 'Resizing and repositioning the map' section in
//the following help topic for more details http://help.esri.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_guidelines.htm
var resizeTimer;
dojo.connect(map, 'onLoad', function(theMap) {
dojo.connect(dijit.byId('map'), 'resize', function() { //resize the map if the div is resized
clearTimeout(resizeTimer);
resizeTimer = setTimeout( function() {
map.resize();
map.reposition();
}, 500);
});
});
}
dojo.addOnLoad(init);
</script>
</head>
<body class="claro">
<div id="content" dojotype="dijit.layout.BorderContainer" design="headline" gutters="true" style="width: 100%; height: 100%; margin: 0;">
<div id="rightPane" dojotype="dijit.layout.ContentPane" region="right">
<div dojoType="dijit.layout.AccordionContainer">
<div dojoType="dijit.layout.ContentPane" id="legendPane" title="Legend" selected="true">
<div id="legendDiv"></div>
</div>
<div dojoType="dijit.layout.ContentPane" title="Natural Disasters" >
<span style="padding:10px 0;">Click to toggle the visibilty of the various natural disasters</span>
<div id="toggle" style="padding: 2px 2px;"></div>
</div>
</div>
</div>
<div id="map" dojotype="dijit.layout.ContentPane" region="center" style="overflow:hidden;">
</div>
</div>
</body>
</html>
... View more
07-08-2011
10:59 AM
|
0
|
1
|
780
|
POST
|
Is this not the place to post these types of questions? As of now, 33 people have views the topic but not one of them has given any insight on how this can be accomplished. Is the question too difficult? It should be pretty straight forward. I am close; I just need someone with a little more experience with the api to tweak it a little. Thanks Timothy
... View more
06-28-2011
08:09 AM
|
0
|
0
|
170
|
POST
|
On one of my layers the query.where = '1=1'; only populates 3/4 of my data? what would cause that?
... View more
06-27-2011
11:21 AM
|
0
|
0
|
637
|
POST
|
Is the query.where cause necessary? I want the whole layer to be displayed. is there a querywhere cause for that?
... View more
06-27-2011
07:01 AM
|
0
|
0
|
637
|
POST
|
I am trying to get my website to add up the population for the cities the user select. I took the http://help.arcgis.com/en/webapi/javascript/arcgis/demos/graphics/graphics_extent_query.html as my base code and added some code from http://help.arcgis.com/en/webapi/javascript/arcgis/demos/query/query_buffer.html I think the problem is the "onComplete" it should be onDrawend, but I do not know how to do that. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<!--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>Points in Extent</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.3/js/dojo/dijit/themes/claro/claro.css">
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.3"></script>
<script type="text/javascript">
dojo.require("esri.map");
dojo.require("esri.toolbars.draw");
dojo.require("esri.tasks.query");
//global variables
var map, defaultSymbol, highlightSymbol, resultTemplate;
function init() {
//create map, set initial extent and disable default info window behavior
map = new esri.Map("map", {
extent: esri.geometry.geographicToWebMercator(new esri.geometry.Extent(-125.90, 44.60, -114.65, 50.22, new esri.SpatialReference({wkid:4326}))),
showInfoWindowOnClick:false
});
dojo.connect(map, "onLoad", initToolbar);
map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"));
//initialize symbology
defaultSymbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([0,0,255]));
highlightSymbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([255,0,0]));
//initialize & execute query
var queryTask = new esri.tasks.QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0");
var query = new esri.tasks.Query();
query.where = "STATE_NAME = 'Washington'";
query.outSpatialReference = {wkid:102100};
query.returnGeometry = true;
query.outFields = ["*"];
queryTask.execute(query, addPointsToMap);
//info template for points returned
resultTemplate = new esri.InfoTemplate("City", "<tr><td>${CITY_NAME}</tr></td>");
dojo.connect(queryTask, "onComplete", function(results) {
var totalPopulation = sumPopulation(results);
var r = "";
r = "<b>The Total Population of Selected Cities is <i>" + totalPopulation + "</i>.</b>";
dojo.byId('inextent').innerHTML = r;
});
}
//initialize drawing toolbar
function initToolbar(map) {
var tb = new esri.toolbars.Draw(map);
//find points in Extent when user completes drawing extent
dojo.connect(tb, "onDrawEnd", findPointsInExtent);
//set drawing mode to extent
tb.activate(esri.toolbars.Draw.EXTENT);
}
//add points to map and set their symbology + info template
function addPointsToMap(featureSet) {
dojo.forEach(featureSet.features,function(feature){
map.graphics.add(feature.setSymbol(defaultSymbol).setInfoTemplate(resultTemplate));
});
}
//find all points within argument extent
function findPointsInExtent(extent) {
var results = [];
dojo.forEach(map.graphics.graphics,function(graphic){
if (extent.contains(graphic.geometry)) {
graphic.setSymbol(highlightSymbol);
results.push(graphic.getContent());
}
//else if point was previously highlighted, reset its symbology
else if (graphic.symbol == highlightSymbol) {
graphic.setSymbol(defaultSymbol);
}
});
//display list of points in extent
dojo.byId("results").innerHTML = "<table><tbody>" + results.join("") + "</tbody></table>";
}
function sumPopulation(results) {
var features = results.features;
var popTotal = 0;
for (var x = 0; x < features.length; x++) {
popTotal = popTotal + features .attributes['POP1990'];
}
return popTotal;
}
dojo.addOnLoad(init);
</script>
</head>
<body class="claro">
Draw an Extent on the map to find all points within this extent
<!-- map div -->
<div id="map" style="width:800px; height:400px; border:1px solid #000;"></div>
<br />
<!-- display number of points in drawn extent -->
<b><span id="inextent">0</span></b>
<!-- list points in extent -->
<div id="results" style="width:400px; height:200px; border:1px solid #000; overflow:auto;">
</div>
</body>
</html>
... View more
06-27-2011
06:53 AM
|
0
|
2
|
620
|
POST
|
you are right, that was a bad example but I did have the same problem with point features. I used chrome developer tool and it come up with the http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.3 serverapi.arcgisonline.com:14Error Line 14 is where the whole function is. I am not sure what that means.
... View more
06-26-2011
01:15 PM
|
0
|
0
|
637
|
POST
|
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/graphics/graphics_extent_query.html I took this code above and inserted our data into it and it will not populate a graphic This is all I changed var queryTask = new esri.tasks.QueryTask("http://1XX.XX.XXX.XXX/ArcGIS/rest/services/Lone/Parcels/MapServer/0"); var query = new esri.tasks.Query(); query.outSpatialReference = {wkid:102100}; query.returnGeometry = true; query.outFields = ["*"]; queryTask.execute(query, addPointsToMap); Any ideas on why it won't produce a graphic or layer on the map?
... View more
06-24-2011
07:16 AM
|
0
|
8
|
1111
|
POST
|
this example shows up blank on IE8 http://help.arcgis.com/EN/webapi/javascript/arcgis/demos/widget/widget_infowindowchart.html here is our basic code that does not work. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9"/> <!--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>Info Window with Chart</title> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.3/js/dojo/dijit/themes/claro/claro.css"> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } #map{padding:0;} </style> <script type="text/javascript">var djConfig = {parseOnLoad: true};</script> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.3"></script> <script type="text/javascript"> dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("esri.map"); dojo.require("esri.layers.FeatureLayer"); dojo.require("dojo.number"); dojo.require("dijit.layout.TabContainer"); var map; function init() { var initialExtent = new esri.geometry.Extent({"xmin":-12464806.28,"ymin":3997513.10,"xmax":-12460506.70,"ymax":4000379.49,"spatialReference":{"wkid":102100}}); map = new esri.Map("map", { extent: initialExtent}); //Add the world imagery to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"); map.addLayer(basemap); var landBaseLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://1XX.XX.169.197/ArcGIS/rest/services/Lone/Parcels/MapServer"); map.addLayer(landBaseLayer); var template = new esri.InfoTemplate(); //flag icons are from http://twitter.com/thefella, released under creative commons template.setTitle("<b>${APN}</b>"); template.setContent(getWindowContent); var parcelsLayer= new esri.layers.FeatureLayer("http://1XX.XX.169.197/ArcGIS/rest/services/Lone/Parcels/MapServer/0",{ infoTemplate:template, outFields:["*"] }); var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([255,0,0,0.0]), 2),new dojo.Color([255,255,0,0.0])); parcelsLayer.setRenderer(new esri.renderer.SimpleRenderer(symbol)); map.addLayer(parcelsLayer); map.infoWindow.resize(300,275); //resize the map when the browser resizes - view the 'Resizing and repositioning the map' section in //the following help topic for more details http://help.esri.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_guidelines.htm var resizeTimer; dojo.connect(map, 'onLoad', function(theMap) { dojo.connect(dijit.byId('map'), 'resize', function() { //resize the map if the div is resized clearTimeout(resizeTimer); resizeTimer = setTimeout( function() { map.resize(); map.reposition(); }, 500); }); }); } function getWindowContent(graphic) { //make a tab container var tc = new dijit.layout.TabContainer({ style:"width:100%;height:100%;", }, dojo.create("div")); //display attribute information var cp1 = new dijit.layout.ContentPane({ title: "Details", content: "<b>Plan Status: </b>" + graphic.attributes.PlanStatus + "<br /><b>Version: </b>" + graphic.attributes.Version + "<br /><b>Lot #: </b>" + graphic.attributes.LotNumber + "<br /><b>APN: </b>" + graphic.attributes.APN + "<br /><b>Phase: </b>" + graphic.attributes.Phase_No + "<br /><b>Product Size: </b>" + graphic.attributes.ProductSz + "<br /><b>Lot SqFt: </b>" + graphic.attributes.Shape_Area }); tc.addChild(cp1); var cp2 = new dijit.layout.ContentPane({ title: "PDF's", content: "<a target='_blank' href='http://en.wikipedia.org/wiki/" + graphic.attributes.APN + "'>Web PDF</a><br /><a target='_blank' href='http://en.wikipedia.org/wiki/" + graphic.attributes.APN + "'>Local PDF</a><br /><a target='_blank' href='http://en.wikipedia.org/wiki/" + graphic.attributes.APN + "'>Web CAD</a>" }); tc.addChild(cp2); var cp3 = new dijit.layout.ContentPane({ title: "Related Plans", content: "<b>Onsite Paving:</b>" + "<br><b>Onsite Paving:</b>" }); tc.addChild(cp3); return tc.domNode; } dojo.addOnLoad(init); </script> </head> <body class="claro"> <div id="mainWindow" dojotype="dijit.layout.BorderContainer" design="headline" gutters="false" style="width: 100%; height: 100%; margin: 0;"> <div id="map" dojotype="dijit.layout.ContentPane" region="center" style="overflow:hidden;"> </div> </div> </body> </html>
... View more
06-24-2011
07:07 AM
|
0
|
0
|
248
|
Online Status |
Offline
|
Date Last Visited |
06-13-2023
10:55 PM
|