|
POST
|
Are you attempting to upgrade from version 2.x? If so, you should read "Migrating to 3.0" documention at http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp_start.htm.
... View more
10-17-2012
10:54 AM
|
0
|
0
|
599
|
|
POST
|
I don't think you'll find this property from as part of the ArcGISDynamicMapServiceLayer object. If you want to access this in your application, you could always do a call to you rest services directory: //function call for fetching a rest Services Page. This will return a dojo.deferred var fetchRestServicesPage = function (path){ return dojo.io.script.get({ url: url, callbackParamName: "callback" }); }; //sample usage var serviceInfoCall = fetchPage("http://services.arcgisonline.com/ArcGIS/rest/services/Specialty/Soil_Survey_Map/MapServer"); //wait for a response before proceeding serviceInfoCall.then(function(serviceInfo){ var documentTitle = serviceInfo.documentInfo.Title; //do what you want with the title here )};
... View more
10-10-2012
11:00 AM
|
0
|
0
|
826
|
|
POST
|
You're still not waiting for the response to be done before proceeding. You could do what your trying to do by nesting the second step inside a callback function:
function getProjectReport(theFid) {
var theDocument, theGraphic
returnTipShape(theFid,function(returnedShape){
console.log(theGraphic.attributes.PROJECT);
.
.
.
});
}
function returnTipShape(param,callback) {
var theParam = param.split(",");
var query = new esri.tasks.Query();
query.where = "FID=" + theParam[0];
query.outFields = ["*"];
query.returnGeometry = true;
var theShape;
//Specify the appropriate point/line map service depending on what was clicked
switch (theParam[1]) {
case "point":
var queryTask = new esri.tasks.QueryTask("http://dmc-arcgis.snoco.co.snohomish.wa.us/SnocoGISdev/rest/services/transportation/tipProjectsPoint/MapServer/0");
break;
case "polyline":
var queryTask = new esri.tasks.QueryTask("http://dmc-arcgis.snoco.co.snohomish.wa.us/SnocoGISdev/rest/services/transportation/tipProjectsLine/MapServer/0");
break;
}
dQuery = queryTask.execute(query);
var dList = new dojo.DeferredList([dQuery]);
dList.then(function(results) {
var featureSet = results[0];
dojo.forEach(featureSet.features, function(feature) {
theShape = feature;
});
callback(theShape);
});
//return theShape;
}
Also, you don't really need a deferredList in this case since you're only doing one call. Deferred lists are really only necessary when you need to wait for the response from multiples requests.
... View more
10-04-2012
09:41 AM
|
0
|
0
|
1226
|
|
POST
|
You're passing the graphic to the console before the execute task has finished running. Place the console.log inside the callback for the execute function. queryTask.execute(query,function(featureSet) {
dojo.forEach(featureSet.features, function(feature) {
theGraphic = feature;
});
console.log(theGraphic.attributes.PROJECT);
}); Just FYI, based on the above code, theGraphic is only going to represent the last item in the featureSet.
... View more
10-03-2012
12:49 PM
|
0
|
0
|
1226
|
|
POST
|
We use the following to handle any url parameters:
//fetch any parameters that were passed with the url
var urlParams = esri.urlToObject(document.location.href).query || {};
//convert each url parameter from a string to a javascript object
for (var prop in urlParams) {
if (urlParams.hasOwnProperty(prop)) {
try {
urlParams[prop] = dojo.fromJson(urlParams[prop]);
}
catch (err) {
//ignore the error
}
}
}
If you pass your layers as an array (i.e. layers=[0,1,2,3,4]), you should be good to go. Each parameter will end up as a property of the urlParams object.
... View more
09-28-2012
11:22 AM
|
0
|
0
|
659
|
|
POST
|
We abandoned ESRI's infoWindow awhile back. As a replacement, we've been using dojo floatingPanes. You can use as many you need and the user can move them around the page. Here is an example if you're interested:http://fwp.mt.gov/gis/maps/huntPlanner/
... View more
09-21-2012
03:09 PM
|
0
|
0
|
2328
|
|
POST
|
Here is my latest installment. I linked to the onClick event of the basemapGallery Nodes: //Listen for a change of basemap (NIM080755)
dojo.forEach(dojo.query(".esriBasemapGalleryNode"),function(galleryNode){
dojo.connect(galleryNode,"onclick",function(){
_this._basemapButton.closeDropDown();
_this._disableAllMapFunctionUntilBasemapUpdates();
});
}); The following function disables the map until it is done updating: //this is a a stopgap measure until ESRI fixes NIM080755
_disableAllMapFunctionUntilBasemapUpdates: function(){
var _this = this;
//disable the map it id done updating the basemap
var mapStandby = new dojox.widget.Standby({target: _this.map.container});
document.body.appendChild(mapStandby.domNode);
mapStandby.startup();
mapStandby.show();
var mapUpdateEndConnect = dojo.connect(_this.map,"onUpdateEnd",function(){
mapStandby.destroy();
dojo.disconnect(mapUpdateEndConnect);
});
} Finally, if all else fails I give the user an alert so they know something might have gone wrong. //added to account for errors caused by NIM080755
window.onerror = function(){
alert("An error has occured.\nYou're map will likely continue to function, but you may see inconsistent results.\nRefresh your browser to start over.");
};
... View more
05-11-2012
11:13 AM
|
0
|
0
|
1418
|
|
POST
|
One way to do this is to search all map layers and look for the "_basemapGalleryLayerType" property. If it is set to "basemap", then you can simply hide the layer. It works in 2.2. I haven't tried it with the other versions of the API, so I'm not sure if the "_basemapGalleryLayerType" property is always available or not. Here's what my function looks like: hideBaseMap: function(){
var _this = this;
dojo.forEach(this.map.layerIds, function(id){
var layer = _this.map.getLayer(id);
if (layer._basemapGalleryLayerType === "basemap") {
layer.hide()
}
});
}
... View more
05-20-2011
11:01 AM
|
0
|
2
|
1212
|
|
POST
|
The following seems to work: var noBaseMap = new esri.dijit.Basemap({ layers:[], title:"None", thumbnailUrl:"images/none.jpg" }); basemaps.push(noBaseMap);
... View more
05-20-2011
10:07 AM
|
0
|
0
|
1212
|
|
POST
|
The response from the sample profile service is a picture, not actual elevation values. Here is a sample usage. If you want to perform your own analysis (or create your own graph) you will need to access some elevation data directly. I'm not sure what the best source would be. ESRI host a globe service at \\fwphlncmstst001\gis but I don't think this is queryable via javascript. Google host elevation data, but I don't know if you use it outside of the google maps API. Any other suggestions?
... View more
03-02-2011
08:44 AM
|
0
|
0
|
640
|
|
POST
|
The following forum pointed me in the right direction. http://forums.arcgis.com/threads/19233-Token-used-in-proxy-not-working-for-Feature-Service (this forum is related to flex, but I assume it still applies conceptually). The fact that the referring URL is set correctly doesn't matter since... "When you generate the token, you should use the IP address of the proxy machine as seen by the ArcGIS Server. This is because the referer header is not passed on by the proxy." I'm not using thet IP address method because I'm embedding the token in the application. We tried embedding the token in the proxy page originally. This worked OK, but we had performance problems on our application (JBOSS) when we started doing load tests. Generating a single token for a user's session and embedding it in the application took care of this problem for us. But now I need the proxy page again. How can I embed the a token in a application and still retain the ability to use the proxy page for "long-winded" requests?
... View more
02-28-2011
10:46 AM
|
0
|
0
|
792
|
|
POST
|
I understand why the request is going through the proxy page, but I still can't figure out why I'm getting an invalid token response. I just checked, and my referrer is set to the same for the get and the post requests (the "Host" is different, but I don't see why this would be relevant).
... View more
02-28-2011
08:00 AM
|
0
|
0
|
792
|
|
POST
|
I have a service with an embedded, long-lived token. I just ran into an instance where I have a map request that's longer than 2048 characters so the API is trying to post the request via our proxy page. When this happens, I get an "Invalid token" response. I have tested the proxy page and it works just fine when the service is not secured. I think the problem is... When I send the regular get request, the Request Header Host is set to the gis server When I send the request via the proxy page, the Request Header Host is set to the web server. I'm not sure if this is the problem or even related, but this is the only real difference I can seem to find between the get and the post requests. Anyone have any thoughts or suggestions?
... View more
02-26-2011
08:34 AM
|
0
|
4
|
1301
|
|
POST
|
I'm trying to add a web service to my content, but I'm not having any luck. I filled out the "add item" dialog box, then click the Add Item button and nothing happens. I was able to successfully upload an web application and an mxd, but not a web service. I tried it in IE7 and FF with the same result. Any suggestions?
... View more
07-09-2010
08:16 AM
|
0
|
2
|
553
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-21-2017 10:00 AM | |
| 1 | 09-11-2015 08:24 AM | |
| 1 | 01-25-2016 12:30 PM | |
| 1 | 05-27-2015 08:12 AM | |
| 1 | 06-09-2015 03:28 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|