|
POST
|
My original application is still showing just the outlines. Do I need a version other than 2.4 of the ESRI JavaScript API? That's my mistake, I was testing against an internal dev server. The updates will (hopefully) be pushed to ArcGIS Online (where the KML service is hosted) tonight and you should see the fix tomorrow. No need to change your version of the JS API.
... View more
08-04-2011
05:25 PM
|
0
|
0
|
1662
|
|
POST
|
I'd never thought of doing that before, but yes, you can do it. Define LODs for your map and it'll have a slider. Here's a working example:
<!doctype html>
<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>Dynamic Map Service with Zoom Slider</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.4/js/dojo/dijit/themes/claro/claro.css">
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.4"></script>
<script type="text/javascript">
dojo.require("esri.map");
var map;
function init() {
var lods = [
{ level: 0 , resolution: 0.3515625 , scale: 147748799.285417 },
{ level: 1 , resolution: 0.17578125 , scale: 73874399.6427087 },
{ level: 2 , resolution: 0.087890625 , scale: 36937199.8213544 },
{ level: 3 , resolution: 0.0439453125 , scale: 18468599.9106772 },
{ level: 4 , resolution: 0.02197265625 , scale: 9234299.95533859 },
{ level: 5 , resolution: 0.010986328125 , scale: 4617149.97766929 },
{ level: 6 , resolution: 0.0054931640625 , scale: 2308574.98883465 },
{ level: 7 , resolution: 0.00274658203125 , scale: 1154287.49441732 },
{ level: 8 , resolution: 0.001373291015625 , scale: 577143.747208662 },
{ level: 9 , resolution: 0.0006866455078125 , scale: 288571.873604331 },
{ level: 10 , resolution: 0.00034332275390625 , scale: 144285.936802165 },
{ level: 11 , resolution: 0.000171661376953125 , scale: 72142.9684010827 },
{ level: 12 , resolution: 0.0000858306884765629 , scale: 36071.4842005414 },
{ level: 13 , resolution: 0.0000429153442382814 , scale: 18035.7421002707 },
{ level: 14 , resolution: 0.0000214576721191407 , scale: 9017.87105013534 },
{ level: 15 , resolution: 0.0000107288360595703 , scale: 4508.93552506767 }
];
map = new esri.Map("map", { lods: lods });
var dyn = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer");
map.addLayer(dyn);
}
dojo.ready(init);
</script>
</head>
<body class="claro">
<div id="map" style="width:900px; height:300px; border:1px solid #000;"></div>
</body>
</html>
I generated those LODs from the old WGS84 ArcGIS Online Imagery map service with this JS in firebug:
dojo.forEach(map.__tileInfo.lods, function(l) { console.log('{ level: ', l.level, ', resolution: ', l.resolution, ', scale: ', l.scale, '},'); });
If you use that snippet, don't forget to remove the last trailing comma.
... View more
08-04-2011
09:46 AM
|
0
|
0
|
2663
|
|
POST
|
This is what you get when you use a dynamic map service. If the first layer you add to your map is a cached service, you'll see the zoom slider. Dynamic map service sample: http://help.arcgis.com/en/webapi/javascript/arcgis/demos/map/map_dynamic.html Cached map service sample: http://help.arcgis.com/en/webapi/javascript/arcgis/demos/map/map_topo.html
... View more
08-04-2011
09:02 AM
|
0
|
0
|
2663
|
|
POST
|
I can't point to one specific thing in your code but here are a few to check: -make sure your query string has all the parameters you're using to get an extent -define popup before you reference it in your map constructor -why are you setting the slider width to null? -are mapServiceURL and aerialServiceURL defined when this function runs? -you can specify your aerial layer as not visible when you define it using the optional options object:
aeriallayer=new esri.layers.ArcGISTiledMapServiceLayer(aerialServiceURL, { visible: false });
... View more
08-04-2011
07:04 AM
|
0
|
0
|
2476
|
|
POST
|
IE's JS errors are notoriously cryptic/bad. Can you post your code?
... View more
08-03-2011
02:56 PM
|
0
|
0
|
2476
|
|
POST
|
I think there are two options: 1. Use a dojo.DeferredList to manage the deferreds returned from geometrySerivce.distance. That way, once all of your deferreds from the geometry service are resolved, you can access the results and go on building your array of objects. As is, if you access the myAttributeArray array immediately after dojo.map() runs, there could be resolved and unfulfilled promises. If you use a deferredList to manage everything, you are guaranteeing that your results will be there. 2. Do it all client side. The API includes client side functions to calculate distance between points. Check out esri.geometry.getLength() or, if you want geodesic distances, create a polyline out of your two points and pass it to esri.geometry.geodesicsLength().
... View more
08-03-2011
02:55 PM
|
0
|
0
|
1257
|
|
POST
|
Yes, check out esri.graphicsExtent(). If your callback, pass your array of graphics to esri.graphicsExtent(), save the return value and then set your map extent using map.setExtent().
... View more
08-03-2011
09:11 AM
|
0
|
0
|
1120
|
|
POST
|
I don't think we have a good way to handle this. As a general rule, I don't use sliders for things that require a server round trip. They're good for doing things like fading between two map services (changing opacity as the slider moves) or filtering features that are already client side (from a feature layer). Curious to hear if anyone else has thoughts on this...
... View more
08-03-2011
08:15 AM
|
0
|
0
|
2452
|
|
POST
|
I put together a simple example with two maps and an event listener for onLayersAddResult for each: http://jsfiddle.net/swingley/JSqnG/ Open the console, load that page and you'll see that both events fire. I'm sure your code has more going on but this is possible...if you want to post a more complete sample of what you're doing we might be able to help.
... View more
08-02-2011
05:18 PM
|
0
|
0
|
1191
|
|
POST
|
You'll probably have better luck in the Google Map API forum or on gis.stackexchange.
... View more
08-02-2011
03:42 PM
|
0
|
0
|
692
|
|
POST
|
Are you adding the same layer object to two different maps?
... View more
08-02-2011
10:17 AM
|
0
|
0
|
1191
|
| 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
|