|
POST
|
Jeff, Can you provide more details of what the cool effect should be, and how it should differ from the out-of-the-box ArcGIS Server JavaScript API panning? Cheers, Steve
... View more
01-09-2012
12:33 PM
|
0
|
0
|
2164
|
|
POST
|
i can't seem to find a simple example of passing a variable to the query task to pan and zoom The sample you referenced may not be perfectly suited to your task - it's passing in the OBJECTID of the feature, then iterating through each graphic on the map to see whether its ID matches. It then zooms to the matching graphic. Another approach is to run a query, then zoom to the extent of the feature(s) which are returned. Assuming that you know the OBJECTID (or some other unique attribute) of your feature, you could use something like this:
//Define a new Query and QueryTask
queryTask = new esri.tasks.QueryTask(UrlToYourLayer);
query = new esri.tasks.Query();
query.returnGeometry = true;
query.outFields = ["field1","field2"];
//The query's where clause will be attribute query to find the feature
query.where = "'OBJECTID = 123'";
//Run the query. Its results are returned in the function showResults
queryTask.execute(query,showResults);
//results is an array of any found features. Assuming you only want the first feature:
function showResults(results) {
var result = results[0];
var extent = result.geometry.getExtent().expand(5.0);
map.setExtent(extent);
}
(Note that I haven't actually tested this so it's more of a conceptual overview.) Cheers, Steve
... View more
01-09-2012
12:28 PM
|
0
|
0
|
2284
|
|
POST
|
As far as I'm aware, it isn't possible to do this. Using a tiled basemap such as Google, Bing or the ESRI samples means you're tied into the Web Mercator projection. The alternative is to create your own tiled basemap using your desired coordinate system. Cheers, Steve
... View more
01-08-2012
03:09 PM
|
0
|
0
|
687
|
|
POST
|
i have passed the variable to javascript but am unable to see how to pass the variable to the map to zoom to the feature(QueryTask?) Hi Carl, Can you provide further information - which variable are you passing to the map? Have you configured a query and querytask? Can you provide a link to your site, or some sample code? Steve
... View more
01-08-2012
03:06 PM
|
0
|
0
|
2284
|
|
POST
|
Hi Matt, Let me know if you need the source code. I'd like the source code please. Stephen dot Lead at Gmail dot com. Cheers, Steve
... View more
01-08-2012
02:59 PM
|
0
|
0
|
4146
|
|
POST
|
Hi Ed, highlight the geometry onmouseover for whichever layers are visible at any one time... the above function works when clicking the map but does anyone know how to achieve the same but only clicking on the feature layer? Set up dojo.connect each time a layer is switched on, at the layer level. If you save this to a variable, you can use dojo.disconnect when the layer is switched off.
//When the layer is switched on:
var1 = dojo.connect(layer1, "onClick"....)
//When the layer is switched off:
dojo.disconnect(var1)
Cheers, Steve
... View more
01-08-2012
01:59 PM
|
0
|
0
|
1154
|
|
POST
|
Hi Ed, I'm not sure if we're talking about the same thing here? I mean that if my HTML page, JS scripts (etc) are stored on my laptop, Bing won't show when I open the map. If I copy the whole set of code (otherwise untouched) onto a web server, Bing suddenly shows. This isn't reproducible with the simple samples, so there's evidently something more complicated going on. Anyway, it's not a show-stopper for me. As a workaround I can test locally using v2.5, then make the change to 2.6 when uploading to the web server. Cheers, Steve
... View more
01-05-2012
01:29 AM
|
0
|
0
|
703
|
|
POST
|
An update on this problem - it seems that Bing maps doesn't show when using v2.6 if the code is hosted locally, but does work if the same code is run from a web server. It's a bit hard to isolate exactly what's happening since the simple samples do work locally. I'll let you know if I can provide a simpler reproducible example. Thanks, Steve
... View more
01-04-2012
02:07 PM
|
0
|
0
|
1546
|
|
POST
|
but I get the error message "activeLayers.hide is not a function" using: activeLayers.push([saLayer, wpLayer, dwpLayer, roadsLayer, wfLayer, dwfLayer]); activeLayers.push({layer:saLayer},{layer:wpLayer},{layer:dwpLayer},{layer:roadsLayer},{layer:wfLayer},{layer:dwfLayer}); Try using push within a for loop, in the same way as you're using hide?
... View more
12-21-2011
08:38 PM
|
0
|
0
|
1516
|
|
POST
|
Any suggestions on what could be causing this and solutions? Nick, I don't have a resolution, but the reversal of the colours can indicate a corrupt shape, possibly caused by the donut not being created correctly when digitizing manually in the JS API. You may need to run some sort of validation geoprocessing service over the digitized shape to verify that it's legitimate. EDIT: perhaps check out the geometry service helpfile entry Good luck, Steve
... View more
12-21-2011
05:01 PM
|
0
|
0
|
861
|
|
POST
|
var len = legendLayers.length;
for (var i = 0; i < len; i++) {
legendLayers.hide();
}
Hi Ed, It looks like you may need another array to hold the feature layers, rather than trying to re-use the one holding the legend layers. You could try something like this:
var fLayers = []; //define a new array for the feature layers
legendLayers.push({
layer : dwfLayer,
title : 'Drinking water facilities'
}
fLayers.push(dwfLayer); //push this layer to the new array (as well as the Legend array)
//Iterate through the feature layers and switch them off
for (var i = 0; i < fLayers.length; i++) {
var layer = fLayers;
layer.hide();
}
Cheers, Steve
... View more
12-21-2011
04:53 PM
|
0
|
0
|
1516
|
|
POST
|
Today some of the sample servers are returning error messages, eg http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/MapServer says: Fire/Sheep (MapServer) Service 'Fire/Sheep' of type 'MapServer' does not exist or is inaccessible. Time for a reboot? Cheers, Steve
... View more
12-17-2011
06:05 PM
|
0
|
1
|
903
|
|
POST
|
Hi Varun, I ended up using the JavaScript API, which suited my client's purposes better. So I haven't used the Silverlight API at all since I posted this question. Sorry I can't help out. Good luck, Steve
... View more
12-15-2011
12:55 PM
|
0
|
0
|
2002
|
| 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
|