|
POST
|
Is it possible to format attribute values in an infoWindow? For example, see the sample at http://help.arcgis.com/EN/webapi/javascript/arcgis/demos/query/query_hover.html The infoWindow template uses population density values from attribute values in a variable: infoTemplate.setContent("<b>2000 Population: </b>${POP2000}<br/>"
+ "<b>2000 Population per Sq. Mi.: </b>${POP00_SQMI}<br/>"
+ "<b>2007 Population: </b>${POP2007}<br/>"
+ "<b>2007 Population per Sq. Mi.: </b>${POP07_SQMI}"); Is it possible to apply formatting to these values, eg so the POP07_SQMI value is rounded to zero decimal places? Thanks, Steve
... View more
11-10-2010
12:42 PM
|
0
|
4
|
1123
|
|
POST
|
Given a REST endpoint, how can I programatically add all of the component layers to the map as FeatureLayers? The sample at http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/map_dynamiclayerlist.html shows how to use LayerInfos to add all of the layers in the REST endpoint to the map, using setVisibleLayers in a DynamicMapService. But I can't see a method to do the same thing using Feature Layers. How can I programatically traverse all of the layers in a Map Server REST endpoint, and add these to the map as Feature Layers? Thanks, Steve
... View more
11-08-2010
06:31 PM
|
0
|
2
|
2171
|
|
POST
|
yeah it looks like a corruption in the original MXD. I created a new one and it seems to be working now. Thanks for checking on it!
... View more
10-23-2010
06:00 PM
|
0
|
0
|
428
|
|
POST
|
I have a polygon layer, which is being displayed with an empty Geometry Type (see http://203.14.35.213/ArcGis1/rest/services/Electoral_results/MapServer/0) This layer is definitely a polygon layer, and I can display it as a Dynamic map service. It's a file geodatabase polygon featureclass, being served via an MSD to ArcGIS Server 10. I have a duplicate database running on a laptop, and it's correctly shown as Geometry Type: esriGeometryPolygon Any idea why it's being listed without a geometry type in this case? I've tried deleting and recreating the service, verified that the featureclass is legitimate, etc. Thanks for any advice, Steve
... View more
10-07-2010
11:02 AM
|
0
|
2
|
1071
|
|
POST
|
Hi Kelly, This is fixed in 2.1 (thanks!) in the sense that the time stops are now positioned at the values entered by the user. However, the time stops are spread out evenly across the time slider, not positioned proportionally along the line. Run the example below, and note the distance between 1970-78 is the same as from 1978-79. In order to show the time extent realistically, the tick marks should be positioned proportionally. Thanks, Steve
<!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" />
<title>Time Slider Test</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.1/js/dojo/dijit/themes/tundra/tundra.css"> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1"></script>
<script type="text/javascript">
var djConfig = {parseOnLoad: true};
dojo.require("esri.map");
dojo.require("esri.dijit.TimeSlider");
var timeSlider;
var map;
function init() {
var startExtent = new esri.geometry.Extent({"xmin":-11412840.550309708,"ymin":4431952.284758817,"xmax" :-11107092.437169151,"ymax":4615401.152643152,"spati alReference":{"wkid":102100}});
map = new esri.Map("map", {extent:startExtent});
var layers = [];
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
layers.push(basemap);
var opLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSWells/MapServer");
opLayer.setVisibleLayers([0]);
var layerDefinitions = [];
layerDefinitions[0] = "FIELD_KID=1000148164";
opLayer.setLayerDefinitions(layerDefinitions);
layers.push(opLayer);
map.addLayers(layers);
dojo.connect(map,"onLayersAddResult",initSlider);
}
function initSlider(results) {
timeSlider = new esri.dijit.TimeSlider({style: "width: 1000px;"},dojo.byId("timeSliderDiv"));
var timeExtent = new esri.TimeExtent();
map.setTimeSlider(timeSlider);
timeSlider.setThumbCount(1);
var myTimeStepIntervals = [new Date("01/01/1970"), new Date("01/01/1978"), new Date("01/01/1979"), new Date("01/01/1989"), new Date("01/01/1994"),new Date("01/01/1995"), new Date("01/01/1996")];
timeSlider.setTimeStops(myTimeStepIntervals);
timeSlider.setThumbIndexes([0]);
timeSlider.setThumbMovingRate(2000);
timeSlider.singleThumbAsTimeInstant(true)
timeSlider.startup();
timeSlider.setLabels(["1970","1978","1979","1989","1994","1995","1996"]);
}
dojo.addOnLoad(init);
</script>
</head>
<body class="tundra">
<div id="map" style="width:100%; height:100%; border:1px solid #000;"></div>
<div id="timeSliderDiv"></div>
</body>
</html>
... View more
09-23-2010
09:17 PM
|
0
|
0
|
696
|
|
POST
|
Hi Carmen, I haven't used AGS with Google Maps v2 API so I'm not positive, but I'd guess that the API key is incorrect or invalid. http://google-maps-utility-library-v3.googlecode.com/svn/trunk/arcgislink/docs/examples.html contains instructions on using AGS with Google Maps v3 API, which avoids the need for the API key. Good luck, Steve
... View more
09-16-2010
07:18 PM
|
0
|
0
|
598
|
|
POST
|
I want to open a time-aware map at a particular time. This works using map.SetTimeExtent - but I'm finding that the associated timeSlider bar does not update to the correct position. See the sample code below for a demonstration. (It's kind of hard to tell but the map is actually showing 1953 when it opens - see the single well on the "Kearney County" label). As far as I can tell, the problem is that calling map.SetTimeExtent(timeExtent) does not call timeSlider.SetThumbIndexes with the appropriate array position. Do you know of a workaround, short of manually calculating the appropriate TimeSlider thumb index and applying this? Thanks, Steve
<!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" />
<title>Set map to given time</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.0/js/dojo/dijit/themes/tundra/tundra.css"> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.0"></script>
<script type="text/javascript">
var djConfig = {parseOnLoad: true};
</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.0"></script>
<script type="text/javascript" language="Javascript">
dojo.require("esri.map");
dojo.require("esri.dijit.TimeSlider");
var map;
var timeSlider;
function init() {
var startExtent = new esri.geometry.Extent({"xmin":-11412840.550309708,"ymin":4431952.284758817,"xmax":-11107092.437169151,"ymax":4615401.152643152,"spatialReference":{"wkid":102100}});
map = new esri.Map("map", {extent:startExtent});
var layers = [];
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
layers.push(basemap);
var opLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSWells/MapServer");
opLayer.setVisibleLayers([0]);
var layerDefinitions = [];
layerDefinitions[0] = "FIELD_KID=1000148164";
opLayer.setLayerDefinitions(layerDefinitions);
layers.push(opLayer);
//add all the layers to the map then initialize the slider.
map.addLayers(layers);
dojo.connect(map,"onLayersAddResult",initSlider);
}
function initSlider(results) {
timeSlider = new esri.dijit.TimeSlider({style: "width: 1000px;"},dojo.byId("timeSliderDiv"));
map.setTimeSlider(timeSlider);
var timeExtent = new esri.TimeExtent();
timeExtent.startTime = new Date("1/1/1921 UTC");
timeExtent.endTime = new Date("12/31/2009 UTC");
timeSlider.setThumbCount(1);
timeSlider.createTimeStopsByTimeInterval(timeExtent,2,'esriTimeUnitsYears');
timeSlider.setThumbMovingRate(2000);
//Show a single point in time
timeSlider.singleThumbAsTimeInstant(true);
timeSlider.startup();
var labels = dojo.map(timeSlider.timeStops, function(timeStop,i){
if(i%2 === 0){
return timeStop.getUTCFullYear(); }
else{
return "";
}
});
timeSlider.setLabels(labels);
//This sets the position of the slider bar.
//timeSlider.setThumbIndexes([16]) will force the bar to move to 1953
timeSlider.setThumbIndexes([0]);
//Now over-write the current time (which is 1921 by default) with a new value
var newTime = new esri.TimeExtent();
newTime.startTime = new Date("01/01/1953 UTC");
newTime.endTime = new Date("01/01/1953 UTC");
//Set the map's time extent to 1953
map.setTimeExtent(newTime);
//Report the time extent - note that the time slider has not updated
var startValString = map.timeExtent.startTime.getUTCFullYear();
var endValString = map.timeExtent.endTime.getUTCFullYear();
dojo.byId("daterange").innerHTML = "<i>" + startValString + " and " + endValString + "<\/i>";
dojo.connect(timeSlider, "onTimeExtentChange", function(timeExtent) {
var startValString = timeExtent.startTime.getUTCFullYear();
var endValString = timeExtent.endTime.getUTCFullYear();
dojo.byId("daterange").innerHTML = "<i>" + startValString + " to " + endValString + "<\/i>";
});
}
dojo.addOnLoad(init);
</script>
</head>
<body class="tundra">
<div>Showing: <span id="daterange"></span></div>
<div id="map" style="width:1000px; height:600px; border:1px solid #000;"></div>
<div id="timeSliderDiv"></div>
</body>
</html>
... View more
09-13-2010
11:06 PM
|
0
|
2
|
1417
|
|
POST
|
Looks like a bug in the time slider. I submitted a new bug for this issue. Thanks Kelly. Can you please let me know the bug tracking number? Cheers, Steve
... View more
09-12-2010
03:10 PM
|
0
|
0
|
696
|
|
POST
|
I'm trying to modify the sample at http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/time_sliderwithdynamiclayer.html so that the tick marks on the Time Slider are set manually. The timeSlider class has a method setTimeStops(timeStops) but I'm getting an error message when I try to use the example code given. My full code is below. When running this code, the labels don't appear and the message "this.fullTimeExtent is undefined" appears in FireBug when I change the time extent. Thanks for any advice, Steve (edited to remove references to Map and TimeSlider from within initSlider function as they are global) <!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" /> <title>Time Slider Test</title> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.0/js/dojo/dijit/themes/tundra/tundra.css"> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.0"></script> <script type="text/javascript"> var djConfig = {parseOnLoad: true}; </script> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.0"></script> <script type="text/javascript" language="Javascript"> dojo.require("esri.map"); dojo.require("esri.dijit.TimeSlider"); var timeSlider; var map; function init() { var startExtent = new esri.geometry.Extent({"xmin":-11412840.550309708,"ymin":4431952.284758817,"xmax":-11107092.437169151,"ymax":4615401.152643152,"spatialReference":{"wkid":102100}}); map = new esri.Map("map", {extent:startExtent}); var layers = []; var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"); layers.push(basemap); var opLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSWells/MapServer"); opLayer.setVisibleLayers([0]); var layerDefinitions = []; layerDefinitions[0] = "FIELD_KID=1000148164"; opLayer.setLayerDefinitions(layerDefinitions); layers.push(opLayer); //add all the layers to the map then initialize the slider map.addLayers(layers); dojo.connect(map,"onLayersAddResult",initSlider); } function initSlider(results) { //var map = this; //var timeSlider = new esri.dijit.TimeSlider({style: "width: 1000px;"},dojo.byId("timeSliderDiv")); timeSlider = new esri.dijit.TimeSlider({style: "width: 1000px;"},dojo.byId("timeSliderDiv")); var timeExtent = new esri.TimeExtent(); map.setTimeSlider(timeSlider); // timeExtent.startTime = new Date("1/1/1970 UTC"); // timeExtent.endTime = new Date("12/31/1976 UTC"); timeSlider.setThumbCount(1); // timeSlider.createTimeStopsByTimeInterval(timeExtent,2,'esriTimeUnitsYears'); var myTimeStepIntervals = [new Date("01/01/1970"), new Date("01/01/1971"), new Date("01/01/1972"), new Date("01/01/1973"), new Date("01/01/1974"),new Date("01/01/1975"), new Date("01/01/1976")]; timeSlider.setTimeStops(myTimeStepIntervals); timeSlider.setThumbIndexes([0]); timeSlider.setThumbMovingRate(2000); timeSlider.singleThumbAsTimeInstant(false) timeSlider.startup(); var labels = dojo.map(timeSlider.timeStops, function(timeStop,i){ if(i%2 === 0){ return timeStop.getUTCFullYear(); } else{ return ""; } }); timeSlider.setLabels(labels); } dojo.addOnLoad(init); </script> </head> <body class="tundra"> <div id="map" style="width:100%; height:100%; border:1px solid #000;"></div> <div id="timeSliderDiv"></div> </body> </html>
... View more
09-09-2010
09:42 PM
|
0
|
4
|
1541
|
|
POST
|
Is there a way to change the mouse pointer when hovering over a graphic or feature? Eg on Google Maps, if you hover over the marker the mouse pointer changes. There's an onMouseOver event on the graphic/feature - is there a way to change the mouse pointer when this event fires? Or can anyone suggest another method? Thanks, Steve
... View more
09-08-2010
10:04 PM
|
0
|
9
|
12636
|
|
POST
|
Thanks for the info Derek. I actually found an easier way - the QueryTask.Execute method returns a FeatureSet, which returns the fieldAliases. http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/featureset.htm#fieldAliases Cheers, Steve
... View more
09-08-2010
06:04 PM
|
0
|
0
|
637
|
|
POST
|
The Query help page at http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/query.htm says: "Outfields - You must list the actual field names rather than the alias names... However, you are able to use the alias names when you display the results. You can set field alias names in the map document" All of the samples use hard-coded alias names, eg: infoTemplate.setContent("<b>2000 Population: </b>${POP2000}<br/>" Does anyone know the syntax to retrieve the field alias programatically from the ArcGIS Server services endpoint? ie, rather than hard-coding 2000 Population, how could you retrieve it from the ${POP2000} parameter? I'm trying to write a generic query function which can be used by multiple layers, with different schemas. Thanks, Steve
... View more
09-06-2010
11:20 PM
|
0
|
3
|
1249
|
|
POST
|
Here's an app I did with a similar style: http://swingley.appspot.com/maps/eq it definitely works - today's big Christchurch earthquake is there. Nice one.
... View more
09-03-2010
10:30 PM
|
0
|
0
|
494
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-17-2014 08:45 PM | |
| 1 | 03-15-2011 04:23 PM | |
| 1 | 10-18-2019 12:50 AM | |
| 3 | 01-22-2019 02:33 PM | |
| 1 | 09-26-2011 10:36 PM |
| Online Status |
Offline
|
| Date Last Visited |
10-20-2022
12:19 AM
|