|
POST
|
We released an update to v2.0 (beta) of the JavaScript API today, here are the highlights of the release: The overview map, originally a code gallery sample, is now part of the JavaScript API. The documentation is here: http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/overviewmap.htm And we have three samples showing how to work with the dijit: http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/map_overviewmap.html http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/map_overviewmapexternal.html http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/layout_styledmap.html We�??ve added several samples that show how to work with Image Services, view them in the Image Service folder on the JS API Samples page: http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm We added tooltips to the drawToolbar, these are configurable and can be turned off by setting the showTooltips constructor option to false. We added Temporal rendering support for polyline and polygon features, we have a sample for point features. http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/renderer_temporal.html We added the esri logo to the maps, the logo can be turned off by setting the Map constructor option for logo to false.
... View more
05-27-2010
11:21 AM
|
0
|
0
|
1377
|
|
POST
|
Can you provide details on the type of issues you are seeing with centerAndZoom at 2.0? I just tested centerAndZoom base 2.0 version, but it still looks like not work well..... Any comment? Regards, Bing
... View more
05-11-2010
10:51 AM
|
0
|
0
|
1046
|
|
POST
|
You can download the proxy page and read more about how to work with one here: http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/ags_proxy.htm
... View more
04-29-2010
09:09 AM
|
0
|
0
|
369
|
|
POST
|
You may be running into the issue described in the following forum thread. This is a problem only in IE, here's the bug number and the link below has a patch you can apply: NIM054763: When running an application that uses the Dojo Border Container and Content Panes for layout an invalid argument error occurs when the browser is resized. This only happens in IE. http://forums.esri.com/Thread.asp?c=158&f=2396&t=301691&mc=5
... View more
04-27-2010
10:02 AM
|
0
|
0
|
357
|
|
POST
|
Ravi, We don't have a method directly on the feature layer to apply a spatial filter - I don't see one in Flex either. However if you want to apply a spatial query directly to the feature layer one approach would be to add a feature layer in selection mode then use selectFeatures to perform a spatial query. Here's a sample that shows how this works, here only features within the specified extent are drawn on the map. <!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"/>
<title>FeatureLayer On Demand</title>
<script type="text/javascript">djConfig = { parseOnLoad:true };</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.0"></script>
<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">
dojo.require("esri.map");
dojo.require("esri.layers.FeatureLayer");
dojo.require("dijit.form.Button");
dojo.require("dijit.Dialog");
var mapLayers = []; //array of layers in client map
var map;
function init() {
var extent = new esri.geometry.Extent({"xmin":-13337231.937022427,"ymin":3914529.1302062804,"xmax":-12909184.578625461,"ymax":4220277.2433469705,"spatialReference":{"wkid":102100}});
map = new esri.Map("map", { extent:extent});
dojo.connect(map, "onLoad", initOperationalLayer);
var imagery = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer");
map.addLayer(imagery);
}
function initOperationalLayer(map) {
var featureLayer = new esri.layers.FeatureLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/Since_1970/MapServer/0",{
mode: esri.layers.FeatureLayer.MODE_SELECTION,
outFields: ["*"]
});
map.addLayer(featureLayer);
var extent = new esri.geometry.Extent({"xmin":-13228997.10497058,"ymin":3961002.843403707,"xmax":-13014973.425772188,"ymax":4113876.899973986,"spatialReference":{"wkid":102100}});
var query = new esri.tasks.Query();
query.geometry = extent;
featureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW);
}
dojo.addOnLoad(init);
</script>
</head>
<body class="tundra">
<div style="position:relative;">
<div id="map" style="width:700px; height:500px; border:1px solid #000;"></div>
</div>
</body>
</html>
... View more
04-27-2010
09:52 AM
|
1
|
0
|
2282
|
|
POST
|
I think it might be the symbology, can you try replacing the line where the renderer for the selection layer with this one: selectionLayer.setRenderer(new esri.renderer.SimpleRenderer(new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH,new dojo.Color([0,255,200]), 14))); And the default renderer line with this one: var defaultRenderer = new esri.renderer.SimpleRenderer(new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 2));
... View more
04-26-2010
02:12 PM
|
0
|
0
|
1045
|
|
POST
|
Ravi, I switched my test case to use a feature layer instead, mine is a feature layer pointing to a map service and the test case still works. This service is public if you'd like to test: opLayer = new esri.layers.FeatureLayer("http://servicesbeta.esri.com/ArcGIS/rest/services/Health/h1n1/MapServer/0",{
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT
}); Which mode are you specifying for your feature layer? We recommend using MODE_SNAPSHOT if you aren't using a large amount of data. If you have a large amount of data you may want to use an ArcGISDynamicMapServiceLayer instead. ONDEMAND_MODE is not recommended because it can result in too many requests to the server.
... View more
04-26-2010
10:15 AM
|
0
|
0
|
820
|
|
POST
|
Ravi, You can use the queryFeatures method to query the feature layer using a spatial filter. The queryFeatures method takes in input query that has a geometry property you can use to define the filter geometry. http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/query.htm
... View more
04-26-2010
10:05 AM
|
0
|
0
|
2282
|
|
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
|
1045
|
|
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
|
1045
|
|
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
|
820
|
|
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
|
688
|
|
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
|
546
|
|
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
|
472
|
|
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
|
751
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-06-2025 03:23 PM | |
| 1 | 11-06-2025 03:21 PM | |
| 2 | 08-13-2025 09:41 AM | |
| 1 | 10-28-2025 09:58 AM | |
| 1 | 08-01-2025 10:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|