|
POST
|
If you add a breakpoint, using a tool like Firebug for Firefox or Developer Tools in IE is there a value returned for the OBJECTID associated with the graphic. The snippet of code below is executed when you hover over a row in the data grid. Dojo.some looks through all the map's graphics until it finds one that meets the criteria. In this case once a graphic is found with the same objectid as the row's id then it will add a selection graphic to the map.
dojo.some(map.graphics.graphics,function(graphic){
if ((graphic.attributes) && graphic.attributes.OBJECTID === rowId) {
var selectedState = new esri.Graphic(graphic.geometry).setAttributes(
graphic.attributes);
selectionLayer.add(selectedState);
return true;
}
});
... View more
04-26-2010
08:25 AM
|
0
|
0
|
1302
|
|
POST
|
You mentioned that the selection isn't syncing up - does this mean that features are getting selected but maybe not the ones you'd expect?
... View more
04-26-2010
07:56 AM
|
0
|
0
|
1302
|
|
POST
|
I setup a quick test using the code below and cannot reproduce the problem. In this test case if you run the application then move both sliders to the same position and start playing you'll see that data displays on the map. It looks like you have an extra space in the following line, perhaps this is the issue or maybe it was an error when copying the code? timeSlider.createTimeStopsByTimeInterval(timeExten t, 1, 'esriTimeUnitsDays'); Here's my test case: <!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>H1N1 Flu Outbreak</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" language="Javascript">
dojo.require("esri.map");
dojo.require("esri.tasks.query");
dojo.require("esri.layers.FeatureLayer");
dojo.require("esri.dijit.TimeSlider")
var timeSlider,map;
var opLayer;
function init() {
map = new esri.Map("map");
var layers = [];
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer");
layers.push(basemap);
opLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://servicesbeta.esri.com/ArcGIS/rest/services/Health/h1n1/MapServer");
layers.push(opLayer);
//add all the layers to the map then initialize the slider
map.addLayers(layers);
dojo.connect(map,"onLayersAddResult",function(results){
timeSlider = new esri.dijit.TimeSlider({},dojo.byId("timeSliderDiv"));
map.setTimeSlider(timeSlider);
timeSlider.setThumbCount(2);
//get the time extent from the H1N1 layer and use that to define the time stops
timeSlider.createTimeStopsByTimeInterval(results[1].layer.timeInfo.timeExtent,1,'esriTimeUnitsDays');
dojo.connect(timeSlider,"onTimeExtentChange",extentChanged);
timeSlider.startup();
});
}
function extentChanged(timeExtent){
//format the dates
console.log(timeExtent.startTime.toUTCString());
console.log(timeExtent.endTime.toUTCString());
var startVal = timeExtent.startTime.getMonth() + 1 + "/" + timeExtent.startTime.getDate() + "/" + timeExtent.startTime.getFullYear();
var endVal = timeExtent.endTime.getMonth() + 1 + "/" + + timeExtent.endTime.getDate() + "/" + timeExtent.endTime.getFullYear();
dojo.byId("timeVal").innerHTML = "<b>H1N1 Flu Outbreak data from " + startVal + " TO " + endVal + "<\/b>";
}
dojo.addOnLoad(init);
</script>
</head>
<body class="tundra">
<div id="timeVal"></div>
<div id="map" style="width:900px; height:600px; border:1px solid #000;"></div>
<div id="timeSliderDiv"></div>
</body>
</html>
... View more
04-23-2010
10:35 AM
|
0
|
0
|
1181
|
|
POST
|
Based on your screen shot the portion of the slider that you are trying to overwrite is the dijitSliderDecrementIconV not the IconH. I ran a quick test and can reproduce the issue in IE6 but I was able to overwrite the css using something like this. If you post the css you are using to workaround this issue I'd be happy to take a look .nihilo .dijitSliderDecrementIconV {
background:url("images/minus.png") no-repeat scroll 2px transparent ;
cursor:pointer;
height:18px;
width:18px;
}
... View more
04-23-2010
08:59 AM
|
0
|
0
|
1019
|
|
POST
|
This text is displayed in the direction info - you could associate a location name rather than address if you wish, for example if I wanted driving directions to display ESRI Redlands and San Diego convention center instead of an address I could add an address attribute with the following information:
var fromLoc = new esri.geometry.Point( -117.194958859564,34.0573637535114,map.spatialReference);
routeParams.stops.features[0] = map.graphics.add(new esri.Graphic(fromLoc, fromSymbol,{address:"ESRI Redlands"}));
var toLoc = new esri.geometry.Point(-117.163797351249,32.7075263536336,map.spatialReference); routeParams.stops.features[1] = map.graphics.add(new esri.Graphic(toLoc, toSymbol,{address:"San Diego Convention Center"}));
... View more
04-20-2010
10:27 AM
|
0
|
0
|
638
|
|
POST
|
Bob, I haven't run into this issue, perhaps there's something missing in the code? Can you post the portion of your code that sets up the editor? Thanks Kelly
... View more
04-20-2010
07:02 AM
|
0
|
0
|
571
|
|
POST
|
Your code was close - but you have to wait until the map loads to add graphics. In the snippet below note that it waits until the onLoad event fires to add the graphics to the map. function init() {
var startExtent = new esri.geometry.Extent(-102.5,36.8,-99.8,38.4, new esri.SpatialReference({wkid:4326}) );
var map = new esri.Map("map", {extent:startExtent});
var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer");
map.addLayer(tiledMapServiceLayer);
dojo.connect(map, 'onLoad', function(map) {
//Create graphics layer for counties
var countyLayer = new esri.layers.GraphicsLayer();
var lat=null
var lon=null;
var markerSymbol = new esri.symbol.SimpleMarkerSymbol();
var atts = {};
atts["ID"] = 1;
lat=37.514;
lon=-101.1719;
var location = new esri.geometry.Point(lon, lat, new esri.SpatialReference({wkid:4326}));
var graphic = new esri.Graphic(location, markerSymbol, atts);
graphic.titleField = "ID";
countyLayer.add(graphic);
map.addLayer(countyLayer);
});
}
... View more
04-19-2010
08:38 AM
|
0
|
0
|
1037
|
|
POST
|
Sure this is possible. If you look at the 'Get Driving Directions' sample you'll see that the input address is geocoded and the x,y values of the best match are used to create a new graphic which is are used as the inputs to the route task. if (type === "from") {
routeParams.stops.features[0] = map.graphics.add(new esri.Graphic(stop.location, fromSymbol, { address:stop.address, score:stop.score }));
}
else if (type === "to") {
routeParams.stops.features[1] = map.graphics.add(new esri.Graphic(stop.location, toSymbol, { address:stop.address, score:stop.score }));
} In the above code you can replace stop.location with a new point that contains the lat,lon values instead.
... View more
04-15-2010
07:12 AM
|
0
|
0
|
638
|
|
POST
|
The 'Map navigation' help topic contains information about how to disable/enable various map navigation functionality like pan, zoom, scroll wheel zoom etc. http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/intro_navigation.htm
... View more
04-08-2010
07:43 AM
|
0
|
0
|
553
|
|
POST
|
Hi John, I'm trying to reproduce the issue you are experiencing but in my test case (see below) OnUpdateStart and OnUpdateEnd fire for each layer that's listening for the event. In my testing both events fire when layers load and update themselves. You are correct, all the update events (onUpdate,onUpdateStart,onUpdateEnd) only fire for visible layers. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>Map loading image</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">
dojo.require("esri.map");
var dynamicMapServiceLayer;
function init() {
var map = new esri.Map("map");
//Takes a URL to a map in a map service.
var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer");
map.addLayer(tiledMapServiceLayer);
dojo.connect(tiledMapServiceLayer, "onUpdateEnd", UpdateEnd);
dojo.connect(tiledMapServiceLayer,"onUpdateStart",UpdateStart);
var statesLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer");
map.addLayer(statesLayer);
dojo.connect(statesLayer,"onUpdateEnd",UpdateEnd);
dojo.connect(statesLayer,"onUpdateStart",UpdateStart);
//Takes a URL to a non cached map service.
dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer");
dynamicMapServiceLayer.setOpacity(0.5);
dynamicMapServiceLayer.setVisibility(false);
map.addLayer(dynamicMapServiceLayer);
dojo.connect(dynamicMapServiceLayer, "onUpdateEnd", UpdateEnd);
dojo.connect(dynamicMapServiceLayer,"onUpdateStart", UpdateStart);
}
function UpdateStart(){
console.log(this.url + " Update Start");
}
function UpdateEnd(){
console.log(this.url + " Update End");
}
function setVisible(){
dynamicMapServiceLayer.setVisibility(!dynamicMapServiceLayer.visible);
}
dojo.addOnLoad(init);
</script>
</head>
<body class="tundra">
<button onClick="setVisible();">Toggle Dynamic Layer Visibility</button>
<div id="map" style="position:relative; width:1024px; height:512px; border:1px solid #000;">
<img id="loadingImg" src="images/loading.gif" style="position:absolute; right:512px; top:256px; z-index:100;" />
</div>
</body>
</html>
... View more
04-05-2010
07:32 AM
|
0
|
0
|
1092
|
|
POST
|
Hi Adam, I think you've already recieved an answer to this question, but I thought I'd post the details here in case others run into this issue. You need to modify the name of the attribute to Attr_<Your Field Name>, which in your case would be "Attr_FreightCost". Take a look at the 'Facility properties' section of the following help topic for details on the attribute input fields. http://help.esri.com/en/arcgisdesktop/10.0/help/index.html#/Service_area_analysis/004700000048000000/ You will also need to make sure that the cadidate field names for the Attr_FreightCost attribute contains the Attr_FreightCost value.
... View more
04-01-2010
08:53 AM
|
0
|
0
|
632
|
|
POST
|
We were having a few issues yesterday and I found a few inconsistencies earlier this morning but it looks like the samples are working now. Kelly
... View more
03-12-2010
05:35 AM
|
0
|
0
|
548
|
|
POST
|
Sorry about that - here are the fixed links. We've updated the ArcGIS JavaScript API to include the following functionality: -Added new methods to the ArcGISImageServiceLayer that allow you to define rendering and mosaic rules for image services. -Added the ServiceAreaTask that helps find service areas around an input location on a network. -Added the ClosestFacilityTask to find the closest facilities to an input location.
... View more
03-11-2010
01:20 PM
|
0
|
0
|
578
|
|
POST
|
We've updated the ArcGIS JavaScript API to include the following functionality: -Added new methods to the ArcGISImageServiceLayer that allow you to define rendering and mosaic rules for image services. -Added the ServiceAreaTask that helps find service areas around an input location on a network. -Added the ClosestFacilityTask to find the closest facilities to an input location.
... View more
03-10-2010
06:10 AM
|
0
|
2
|
1069
|
|
POST
|
Have you enabled editing on the feature service? http://help.esri.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#/Feature_services_operations/009300000023000000/ You may also want to check the permissions for the ArcSDE data: http://help.esri.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#/Authoring_feature_services/009300000021000000/
... View more
02-26-2010
06:50 AM
|
0
|
0
|
2070
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-31-2026 08:27 AM | |
| 1 | 03-26-2026 09:07 AM | |
| 1 | 03-26-2026 10:11 AM | |
| 1 | 03-24-2026 02:23 PM | |
| 1 | 03-17-2026 02:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|