|
POST
|
I use BasemapGallery object to navigate my map services. so when I change the map service, how refresh the TOC control? BasemapGallery has an event onSelectionChange - listen for this, and refresh the TOC when this occurs.
... View more
04-09-2012
02:50 PM
|
0
|
0
|
2582
|
|
POST
|
I could be wrong, but I believe that the LODs cannot be changed once the map has been instantiated - they become an intrinsic part of the map object when you issue the new map command. I can get lods from the arcgisonline World_imagery service... However, upon changing to a bing maps aerial, the above lods no longer apply Are you sure about that? If both basemaps (ArcGIS Online world imagery and Bing Maps) are using the same coordinate system, then the LODs should apply in both cases. As far as I know, both of these maps are using Web Mercator ("spatialReference" : {"wkid" : 102100}) so you should be able to change between them as in this example. 1. where do I get the lods info for the bing aerial? 2. how would I re-apply lods, changing the basemap tics after the user selects a different basemap? 1. I believe these LODs are the same as for the ArcGIS Online example 2. I don't believe this is possible without destroying the map object and creating a new one. Cheers, Steve
... View more
04-04-2012
06:59 PM
|
0
|
0
|
716
|
|
POST
|
I need to zoom to ALL the features returned, not just the 1st feature. I tried to modify your sample but was not getting anywhere. See the section:
function showResults(results) {
//This function is run when the query has finished.
//It zooms the map to the extent of the first feature returned by the query.
var result = results.features[0];
var extent = result.geometry.getExtent().expand(5.0);
You'll want to iterate through each feature and union the extent so that it expands to include all features. Pseudo-code is:
var fullExtent;
for each result in results:
thisExtent = result.geometry.getExtent();
fullExtent.union(fullExtent);
I haven't tested this, so you might need to initialise fullExtent as the extent of the first feature, before union-ing it with all of the other features' extents. Good luck, Steve
... View more
03-29-2012
04:16 PM
|
0
|
0
|
2287
|
|
POST
|
Hi Jason, FWIW this works for me in IE9 on Windows 7. In IE8 mode, it returns an error message esri.layers.FeatureLayer: objectIdField is not set [url: http://gis.naperville.il.us/ArcGIS/rest/services/EAB/MapServer/1] I haven't looked at your code to see why this is a problem, but hopefully that's an easy fix (switch on the OBJECTID field on that layer, and refresh the ArcGIS Server service). Steve
... View more
03-28-2012
02:22 PM
|
0
|
0
|
906
|
|
POST
|
You can knock it out in CSS:
.esriPopup .actionsPane {
display: none;
}
... View more
03-28-2012
02:11 PM
|
0
|
0
|
1469
|
|
POST
|
See this Identify sample which runs an IdentifyTask on a Dynamic map service:
dojo.connect(map,"onClick", doIdentify);
identifyTask =new esri.tasks.IdentifyTask("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/Parcels/MapServer");
identifyParams = new esri.tasks.IdentifyParameters();
identifyParams.layerIds =[0,2];
This sample contains pre-prepared HTML to handle the results, depending on which layer they are from:
if (idResult.layerId === 0) {
if (!bldgResults.displayFieldName) {bldgResults.displayFieldName = idResult.displayFieldName};
bldgResults.features.push(idResult.feature);
}else if (idResult.layerId === 2) {
if (!parcelResults.displayFieldName) {parcelResults.displayFieldName = idResult.displayFieldName};
parcelResults.features.push(idResult.feature);
}
<div id="bldgTab" dojoType="dijit.layout.ContentPane" title="Buildings"></div>
<div id="parcelTab" dojoType="dijit.layout.ContentPane" title="Tax Parcels"></div>
I need to configure this to be dynamic rather than checking "if layer = building, elseif layer = parcel". An option could be to set an infoTemplate (containing the required formatting of the results) while configuring the IdentifyTask. see line 75: var idResult = idResults; The result of the IdentifyTask (idResult.feature) is a graphic, so has an infoTemplate property. Can I set the infoTemplate for the layer before the IdentifyTask is run, so that the identifyResults are formatted using the infoTemplate's settings? Thanks, Steve
... View more
03-27-2012
07:58 PM
|
0
|
1
|
1049
|
|
POST
|
Now i need to show the related point when clicking Grid row see the Find Results in Data Grid sample for some suggestions.
... View more
03-27-2012
03:09 PM
|
0
|
0
|
757
|
|
POST
|
Thanks Domenico, I'm getting closer. But still not working 100% yet. I've modified one of the Esri samples to deliver the symbology via the JSON file:
itemData ={
"symbols":[
{
"fillStyle": 'esriSFSSolid',
"lineStyle": 'esriSLSSolid',
"lineWeight": 3,
"lineColor": [255, 0, 0],
"fillColor": [125, 125, 125, 0.35]
}
]
};
var fillStyle = itemData.symbols[0].fillStyle;
var lineStyle = itemData.symbols[0].lineStyle;
var lineWeight = itemData.symbols[0].lineWeight;
var lineColor = itemData.symbols[0].lineColor;
var fillColor = itemData.symbols[0].fillColor;
var highlightSymbol = new esri.symbol.SimpleFillSymbol(fillStyle, new esri.symbol.SimpleLineSymbol(lineStyle, new dojo.Color(lineColor), lineWeight), new dojo.Color(fillColor));
This is almost working, but isn't quite right. Any further tips? Thanks, Steve
... View more
03-27-2012
03:06 PM
|
0
|
0
|
1223
|
|
POST
|
Are you using toJson() ? (mySymbol.toJson()) Would that work for any property? eg mode: esri.layers.FeatureLayer.MODE_SELECTION? Basically, I'm trying to extend the itemData object in the example above, for example to specify the feature layer mode and other properties. Thanks, Steve
... View more
03-26-2012
10:49 PM
|
0
|
0
|
1223
|
|
POST
|
The Create Web Map from JSON example shows how to pass parameters from a configuration file to the map:
webmap.itemData ={
"operationalLayers":[{
"url":"http://server.arcgisonline.com/ArcGIS/rest/services/Specialty/Soil_Survey_Map/MapServer",
"visibility":true,
"opacity":0.75,
"title":"Soil Survey Map",
"itemId":"204d94c9b1374de9a21574c9efa31164"
}]
var layers = response.itemInfo.itemData.operationalLayers;
All of these items are either text, numbers, or boolean. How can I pass an ArcGIS object via JSON? For example, I want to specify a symbol using the same syntax as above. How would I include this symbol in the JSON?
new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT,
new dojo.Color([255,0,0]), 2),new dojo.Color([255,255,0,0.25]));
If I include this in the JSON without quotation marks, it's marked as an error since the JSON file doesn't know what esri.symbol.SimpleFillSymbol means. If I quote it, ArcGIS doesn't recognise it as an object since it's now a string. Do I need to break it into the component parts (STYLE_SOLID, STYLE_DASHDOT, [255,0,0], [255,255,0,0.25]) then reassemble? Thanks for any tips, Steve
... View more
03-26-2012
09:32 PM
|
0
|
5
|
1715
|
|
POST
|
Along similar lines to James's approach, you could convert the shapefile to JSON then create a feature layer from the feature collection.
... View more
03-26-2012
08:52 PM
|
0
|
0
|
3434
|
|
POST
|
This kind of makes sense, since the cache is just a bunch of images which are pre-compiled for fast drawing. I imagine that cached layers weren't designed with time-awareness in mind. I was wondering if anyone can share some code with using time-aware tiled maps. Not code, but an approach you could try - build a separate cache for each "node" on the time-line, and build a slider control which shows the relevant cache layer as the slider is moved along the timeline.
... View more
03-18-2012
04:48 PM
|
0
|
0
|
1003
|
|
POST
|
How do I have the popup close or not even display if the results are NULL or return "No information Available"?
deferred.addCallback(function(response) {
// response is an array of identify result objects
Try if(response.length <1) Steve
... View more
03-18-2012
04:27 PM
|
0
|
0
|
2141
|
|
POST
|
how can I trap for the lack of results returned within the executeIdentifyTask so that i can dynamically alter the popup content. The identifyTask fires an onComplete event, which contains the results of the identifyTask (as an array of features). You could check this to see whether there is anything to report, using identifyResults.length Steve
... View more
03-18-2012
04:24 PM
|
0
|
0
|
1464
|
|
POST
|
can this API connect with my PostgreSQL because i only found the sample how to add layer from our shapefile, GPX etc, but not connecting with our database ... Are you trying to load spatial data (points, lines or polygons) rather than tabular data? If so, you'll need some kind of spatial server, to provide spatial features to the ArcGIS Server JavaScript API. Typically you would use ArcGIS Server, but you could also use GeoServer or similar open source products (since you mentioned PostgreSQL). ArcGIS Server would allow you to serve tiled layers, dynamic layers or feature layers, while I believe GeoServer would limit you to serving WMS layers. Steve
... View more
03-18-2012
02:52 PM
|
0
|
0
|
2004
|
| 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
|