|
POST
|
I did something like this a while back in a dijit I built: http://swingley.appspot.com/maps/zoomto Here's the relevant code:
// serialize the extent to JSON, create a new extent to later pass to the map
var featExt = new esri.geometry.Extent(ext.toJson());
// listen to onExtentChange and then show a
// graphic for the selected feature's extent
this.extHandle = dojo.connect(this.map, 'onExtentChange', this, function() {
var outline = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0, 173, 230, 1]), 3),
symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, outline, new dojo.Color([0, 0, 128, 0])),
extGraphic = new esri.Graphic(featExt, symbol);
this.map.graphics.add(extGraphic);
// fade out the graphic and remove it
var fo = dojo.fadeOut({
'node': extGraphic.getDojoShape().getNode(),
'duration': 1500,
});
// remove the graphic and clean up the event listeners
// after the animation plays
this.foHandle = dojo.connect(fo, 'onEnd', this, function() {
this.map.graphics.remove(extGraphic);
dojo.disconnect(this.extHandle);
dojo.disconnect(this.foHandle);
});
fo.play();
});
// set the new extent
this.map.setExtent(featExt, true);
Another option is to use dojox.gfx.fx to fade out the graphic. Here's an example: http://jsfiddle.net/swingley/3VsgL/
... View more
10-26-2011
09:13 AM
|
0
|
0
|
1952
|
|
POST
|
Why not use onZoomEnd instead? I think that will get you what you want. Also, I know this is just a simple repro page but you could remove your jquery dependency by using dojo.byId('someId').innerHTML instead of $('#someId').text().
... View more
10-25-2011
10:35 AM
|
0
|
0
|
1002
|
|
POST
|
If you want everything to go over https to avoid IE's warning(s), you can build the basemap gallery manually. Here's an example: https://servicesbeta.esri.com/demos/https/basemap-gallery.html
... View more
10-25-2011
10:10 AM
|
0
|
0
|
424
|
|
POST
|
Specifying opacity is causing the layer to disappear in IE. We'll look into this. As a workaround, can you only specify opacity if you're in a non-IE browser? Something like ...
if ( ! dojo.isIE ) {
milRadar.setOpacity(0.5);
}
... View more
10-24-2011
08:29 AM
|
0
|
0
|
2098
|
|
POST
|
Is IE throwing any errors? Is there a little yellow icon with the black ! in the lower left corner?
... View more
10-20-2011
01:10 PM
|
0
|
0
|
2098
|
|
POST
|
Gladly. We'll either fix this or update the docs for the next release(2.6).
... View more
10-20-2011
12:32 PM
|
0
|
0
|
1542
|
|
POST
|
Looks like a bug, thanks for reporting this. In the meantime, here's a workaround:
var topoBaseLayer = new esri.layers.WMSLayer("http://wms.ess-ws.nrcan.gc.ca/wms/toporama_en");
topoBaseLayer.setVisibleLayers(["limits", "vegetation", "builtup_areas", "designated_areas", "hydrography", "hypsography", "water_saturated_soils", "landforms", "constructions", "water_features", "road_network", "railway", "populated_places", "structures", "power_network", "feature_names"]);
dojo.connect(topoBaseLayer, 'onLoad', function(lyr) {
lyr.setImageFormat("png");
});
map.addLayer(topoBaseLayer);
... View more
10-20-2011
11:52 AM
|
0
|
0
|
1542
|
|
POST
|
No personal experience with Android, but have heard plenty of mixed/negative things about its browser. Are you sure the version you're using supports touch events?
... View more
10-19-2011
03:12 PM
|
0
|
0
|
2310
|
|
POST
|
...is there a JSON or XML format I could supply to the Javascript API directly? Yes, take a look at the feature layer from feature collection sample. That shows how you can create a JSON object and pass it to the FeatureLayer constructor to get a feature layer you can add to your map.
... View more
10-19-2011
09:37 AM
|
0
|
0
|
4266
|
|
POST
|
Could the localhost <snip> be causing the problem? Yes, using localhost is the problem. Your KML file has to be publicly accessible to be used with the JS API. This is documented in the Working with KML Layers topic: To add a KML file(.kml or .kmz) to a map, the KML must be available via a publicly accessible URL. Locally hosted or KML files inside a firewall are not supported. The reason behind this requirement is that the KMLLayer class relies on a service hosted on ArcGIS.com to convert the actual KML to JSON. You can see this happening with firebug or chrome dev tools...here's the URL that's genereated from the simple KML layer sample: http://utility.arcgis.com/sharing/kml?url=http://dl.dropbox.com/u/2654618/kml/Wyoming.kml&model=simple&folders=&outSR={"wkid":4326}&callback=dojo.io.script.jsonp_dojoIoScript2._jsonpCallback
... View more
10-19-2011
09:12 AM
|
0
|
0
|
4266
|
|
POST
|
Thanks for the additional info. Are you able to post the rest of your code?
... View more
10-18-2011
09:31 AM
|
0
|
0
|
1482
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-23-2012 07:54 AM | |
| 1 | 05-28-2010 08:31 AM | |
| 1 | 11-12-2012 08:12 AM | |
| 3 | 02-23-2012 10:57 AM | |
| 1 | 06-27-2011 08:51 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|