|
POST
|
Hi, Hopefully a simple one, but I can't crack it. I'm using the editor and template picker to allow editing of a layer through the API and this works great. However in this instance there is no need for the infoWindow to appear when a user clicks a shape to edit, i.e. I don't want it to pop-up, I just want to be able to edit the shape, not the attributes. So how do you prevent the infoWindow appearing? Thank you, Mark. add map.infoWindow.hide(); in your event handler to hide the infoWindow.
... View more
03-28-2011
12:13 PM
|
0
|
0
|
1878
|
|
POST
|
I'm using a TextSymbol to label points I'm placing on my map. Problem is, sometimes it can be hard to read because of all the things going on with the map. Is it possible to put the TextSymbol inside a box, give it a background color, or highlight the text in some way to help it stand out from the background? There's no built-in way to change anything but the alignment and the underline/overline, but I was hoping someone might know a trick for this. http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/textsymbol.htm How about create the same textsymbol twice. One as the text, one as the shade (give it a dark gray color and some offset from the other one so that it looks like the shadow of the other one).
... View more
03-23-2011
05:04 AM
|
0
|
0
|
767
|
|
POST
|
Ok, here goes: After literally playing around with pretty much every combination of code, in the blind hope that something would "appear" to me, I have discovered the following: When passing the layer object via a parameter to my function (after the layer has loaded): - the object can be written in full to the console - specific object properties are empty/null/bank and cannot be written However, when I run the exact same procedure, but call the layer object directly (i.e. no variables are passed as arguments to the function): - the object can be written in full to the console - any object property can be successfully read - including the layerInfos array The function argument seems to be the culprit, because even if I reference the original layer object, when an arbitrary (unused) argument is shared to the function, it stops working again. Now, Im not a professional developer, but that sure seems strange to me! Dont suppose anyone can throw some light on this conundrum? Richard. I looked at your code statement: dojo.connect(coreData, "onLoad", buildLayerList(coreData)); buildLayerList(coreData) suppose to be a delegate meaning the name of the handler not the handler itself. So your statement should looks like dojo.connect(coreData, "onLoad", buildLayerList). Unless you define the handler directly in your statement like this: dojo.connect(coreData, "onLoad", function(coreData){ /* by the way the argument coreData here * is just a reference of coreData, not the coreDate * argument in dojo.connect itself * so it is confusing, should use somthing like layer */ var infos = coreData.layerInfos; for (var i = 0; i < infos.length; i++) { ...... } }); ....
... View more
03-18-2011
05:21 AM
|
0
|
0
|
1813
|
|
POST
|
Simon, Did you ever figure out the proper code structure? I'm running into the same issue with drawing a polygon to do a query task. Every click on the does a new identify as well as draws the polygon... thanks Here is my thought: Since Identify and measure tool all need a map's onclick handler to start. you could create a global variable such as actionType to differentiate the identify or measure action. In your handler use the logic to take different actions. Somthing like: var actionType; //global vaiable function init() { ... dojo.connect(map, "onclick", clickAction); ... } function identifyBtn_click() { actionType ="identify"; ... } function measureBtn_click() { actionType ="measure"; ... } function clickAction(evt) { switch (actionType) { case "identify": ...put identify logic here... break; case "measure": ...put measure logic here... break; .... } } Hope it will give you some idea. Good luck
... View more
03-17-2011
11:44 AM
|
0
|
0
|
1285
|
|
POST
|
so can you show an example of your code? i'm not so sure if the problem lies with ver 9.3.1 or ver 10.. the problem lies with the version of the API... I'm using v2.2 of the Javascript API .... here's my code and it just dies at the "query.where" line... if i take out the ".. ORDER BY" and just use query.where = "ACTIVE = 'Y'" then it works without a hitch
var queryTask = new esri.tasks.QueryTask(serviceURL + "/" + index);
var query = new esri.tasks.Query();
query.returnGeometry = false;
query.outFields = ["INDEX", "ADDRESS", "ZIP"];
query.where = "ACTIVE = 'Y'.. ORDER BY INDEX";
queryTask.execute(query,queryResults);
what is the two dots for in your code ".. ORDER BY INDEX"?
... View more
03-16-2011
05:10 AM
|
0
|
0
|
2123
|
|
POST
|
I'm Add Layer Graphic Layer on the MAP, but the graphic on the layer move when i pan around. I want Graphic Layer move match coordinate. i editing form code not work. can u help me For example: you can't just have var NewGraphics NewGraphics = new esri.layers.GraphicsLayer({}); map.addLayer(NewGraphics); Instead you have to have NewGraphics = new esri.layers.GraphicsLayer({}); dojo.connect(map, "onLoad", function() { map.addLayer(NewGraphics); }); set map's property displayGraphicsOnPan to false. so that graphic wouldn't display until the panning is over. It is less confusing and improve performance too.
... View more
03-16-2011
05:02 AM
|
0
|
0
|
560
|
|
POST
|
Hello all, This has to be easy, but I cannot seem to form the expression correctly. How can I extract the actual longitude value from the following web query (is a text string at the point where I am wanting to extract)? Vehicle ID:truck1 lat:34.833730000000003 lon:-82.352369999999993 dir:90.0 spd:0.0 lck:6 time:151842 date:03142011 trig:2 eof<br> I can match "lon:" using myString.match(/(lon:)/g) but I cannot seem to get the portion associated with the value. I need -82.352369999999993 or lon:-82.352369999999993 The number of digits for the longitude is not always the same, but it is always followed by a space then dir: Thanks in advance. Carmen try this: function getlon(myString) { var strArray = myString.split(" "); for (var i = 0; i < strArray.length; i++) { if (strArray.indexOf("lon:") > -1) alert(strArray.split(":")[1]); } }
... View more
03-15-2011
10:28 AM
|
0
|
0
|
2256
|
|
POST
|
So has anyone confirmed that this works? I'm trying this and it doesn't seem to work. I used ORDER BY in you code a couple of times and I have no problem with it. It is an added feature on 9.3.1. I don't see why it would not work on 10...
... View more
03-15-2011
05:44 AM
|
0
|
0
|
2123
|
|
POST
|
myns.queryFacilities = function () { var myQueryTask = new esri.tasks.QueryTask(myns.basemapURL + "/" + myns.facilityLayerID.toString() ); var myQuery = new esri.tasks.Query(); myQuery.where = "AMS_FacID is not null"; myQuery.outFields = ['AMS_FacID', 'FAC_NAME']; //, 'LLat', 'LLong']; myQuery.returnGeometry = true; dojo.connect (myQueryTask, "onComplete", myns.facilityQuerySuccess); dojo.connect (myQueryTask, "onError", myns.facilityQueryError); myQueryTask.execute(myQuery); }; Your code looks OK. Not sure what is wrong. Change your code a little bit and test it. Like myQuery.where = "AMS_FacID >0" (assuming it is a numeric field); Change dojo.connect (myQueryTask, "onComplete", myns.facilityQuerySuccess); dojo.connect (myQueryTask, "onError", myns.facilityQueryError); myQueryTask.execute(myQuery); into one statement. myQueryTask.execute(myQuery, myns.facilityQuerySuccess, myns.facilityQueryError ); Good luck!
... View more
03-11-2011
09:51 AM
|
0
|
0
|
754
|
|
POST
|
I have a service on a file geodatabase that I query using the javascript API. The query works fine in IE but fails with NS_ERROR_XPC_NOT_ENOUGH_ARGS on Firefox. The stack trace from firebug is below. A. Anyone else have problems with firefox vs ie using esri.tasks.QueryTask and esri.tasks.Query? B. How do you debug into dojo so you can see where the problem actually occurs? C. Any settings or addons that could affect this? The query is returning polygon geometry for 200-300 features with no problem for IE8. Thanks in advance for any help or insight into this. Brad asyncError = [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://myhost:8080/CWServiceRequest/Scripts/csrcode.js :: anonymous :: line 143" data: no] { message="Not enough arguments", result=2153185281, more...} toString()arcgis?v=2.1 (line 14) constructor(err=[Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://myhost:8080/CWServiceRequest/Scripts/csrcode.js :: anonymous :: line 143" data: no] { message="Not enough arguments", result=2153185281, more...}, _758=undefined)arcgis?v=2.1 (line 48) err = [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://myhost:8080/CWServiceRequest/Scripts/csrcode.js :: anonymous :: line 143" data: no] { message="Not enough arguments", result=2153185281, more...} _758 = undefined toString()arcgis?v=2.1 (line 14) constructor(_954=undefined, io=undefined, _955=undefined, _956=undefined)arcgis?v=2.1 (line 48) _954 = undefined io = undefined _955 = undefined _956 = undefined toString()arcgis?v=2.1 (line 14) constructor(r=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...}, i=Object { args={...}, url="http://boigiscw02/arcgi...oScript2._jsonpCallback", more...})arcgis?v=2.1 (line 48) constructor(_1d0=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...}, io=Object { args={...}, url="http://boigiscw02/arcgi...oScript2._jsonpCallback", more...})arcgis?v=2.1 (line 48) toString(_2b4=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...})arcgis?v=2.1 (line 14) toString()arcgis?v=2.1 (line 14) toString(_143=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...})arcgis?v=2.1 (line 14) toString(_149=Object { displayFieldName="FAC_NAME", fieldAliases={...}, more...})arcgis?v=2.1 (line 14) toString()arcgis?v=2.1 (line 14) toString(_143=Object { promise={...}, ioArgs={...}, more...})arcgis?v=2.1 (line 14) toString(_149=Object { promise={...}, ioArgs={...}, more...})arcgis?v=2.1 (line 14) constructor(dfd=Object { promise={...}, ioArgs={...}, more...})arcgis?v=2.1 (line 48) toString()arcgis?v=2.1 (line 14) toString()arcgis?v=2.1 (line 14) Can you post the code portion on your query. It looks like something is missing on your query definition.
... View more
03-11-2011
08:21 AM
|
0
|
0
|
754
|
|
POST
|
I'm doing this same thing, using the same method. It works for me some of the time. I have a map that puts a route on there, similar to driving directions you'd get from Google maps and whatnot. Sometimes, it zooms in perfectly. Sometimes it zooms in too far, so it cuts the part of the route off. Any idea what would cause this? Use the map.setExtent(yourExtent, true) instead of map.setExtent(yourextent). It will garantee that your extent will fully show.
... View more
03-10-2011
10:16 AM
|
0
|
0
|
2115
|
|
POST
|
Well it certainly give an answer. However, there are cases where you want to access and/or change the properties such as layer visibility before adding the layer to the map. How do you address those cases? After carefully review the API. Kelly, you are right on this! Layer's onLoad event happens before adding the layer to the map. So you indeed can access or change the properties before adding the layer to the map.
... View more
03-10-2011
05:55 AM
|
0
|
0
|
1813
|
|
POST
|
Here's a snippet that shows how to access the layer properties- in order to access all the information you'll need to wait until the layer is loaded.
dojo.connect(operationalLayer,"onLoad",function(){
console.log(operationalLayer.version);
console.log(operationalLayer.layerInfos);
console.log(operationalLayer.layerInfos[0].name);
});
Well it certainly give an answer. However, there are cases where you want to access and/or change the properties such as layer visibility before adding the layer to the map. How do you address those cases?
... View more
03-10-2011
05:36 AM
|
0
|
0
|
1813
|
|
POST
|
Hello, I am having trouble accessing the objects of a dynamiclayer using JSAPI v2.1. Its strange, because Im almost certain that I have done it before.. I have the following lines executing: console.log("---- OBJECT DEBUG STARTS HERE ----");
console.log(layer);
console.log(layer.version);
console.log(layer.layerInfos);
console.log("---- OBJECT DEBUG END HERE ----"); Chrome console shows the following: ---- OBJECT DEBUG STARTS HERE ----
basemapviewer.html:118
a
_defaultVisibleLayers: Array[29]
_div: HTMLDivElement
_divAlphaImageFunc: function (){return _bb.apply(_ba,arguments||[]);}
_errorHandler: function (){return _bb.apply(_ba,arguments||[]);}
_exportMapImageHandler: function (){return _bb.apply(_ba,arguments||[]);}
_img: HTMLImageElement
_imgSrcFunc: function (){return _bb.apply(_ba,arguments||[]);}
_img_dragOrigin: Object
_img_loading: HTMLImageElement
_inherited: Object
_initLayer: function (){return _bb.apply(_ba,arguments||[]);}
_layerIndex: 2
_load: function (){return _bb.apply(_ba,arguments||[]);}
_loadCallback: undefined
_map: a
_onExtentChangeHandler_connect: Array[4]
_onPanHandler_connect: Array[4]
_onResizeHandler_connect: Array[4]
_onZoomHandler_connect: Array[4]
_opacityChangeHandler_connect: Array[4]
_params: Object
_setIsPNG32: function (){return _bb.apply(_ba,arguments||[]);}
_startRect: Object
_tileErrorHandler: a
_tileLoadHandler: a
_titleForLegend: "INFORMATION"
_unsetMap_connect: Array[4]
_updateStarted: true
_url: Object
_visibilityChangeHandler_connect: Array[4]
capabilities: "Map,Query,Data"
copyright: ""
description: ""
dpi: 96
fullExtent: a
getImageUrl: function (){return _bb.apply(_ba,arguments||[]);}
id: "layer2"
imageFormat: "png8"
imageTransparency: true
initialExtent: a
isPNG32: undefined
layerInfos: Array[29]
legendResponse: Object
loaded: true
onLoad: function (){var ap=Array.prototype,c=arguments.callee,ls=c._listeners,t=c.target;var r=t&&t.apply(this,arguments);var i,lls;lls=[].concat(ls);for(i in lls){if(!(i in ap)){lls.apply(this,arguments);}}return r;}
onOpacityChange: function (){var ap=Array.prototype,c=arguments.callee,ls=c._listeners,t=c.target;var r=t&&t.apply(this,arguments);var i,lls;lls=[].concat(ls);for(i in lls){if(!(i in ap)){lls.apply(this,arguments);}}return r;}
onUpdateEnd: function (){var ap=Array.prototype,c=arguments.callee,ls=c._listeners,t=c.target;var r=t&&t.apply(this,arguments);var i,lls;lls=[].concat(ls);for(i in lls){if(!(i in ap)){lls.apply(this,arguments);}}return r;}
onVisibilityChange: function (){var ap=Array.prototype,c=arguments.callee,ls=c._listeners,t=c.target;var r=t&&t.apply(this,arguments);var i,lls;lls=[].concat(ls);for(i in lls){if(!(i in ap)){lls.apply(this,arguments);}}return r;}
opacity: 0.75
ovcConnect: Array[4]
spatialReference: a
units: "esriDecimalDegrees"
url: "--removed--"
useMapImage: false
version: 10.01
visibleLayers: Array[29]
__proto__: anonymous
basemapviewer.html:119undefined
basemapviewer.html:120[]
basemapviewer.html:122---- OBJECT DEBUG END HERE ---- What you can see here is that the first console line prints the layer object ("a") - have expanded it to show all the objects stored within it (including "version" and "layerInfos"). However, when it is required to write one of these objects, it shows "undefined" and an empty array. I have tried accessing by looping through the object as well, with the same results. I have tried calling the object using different JS notation, without success. I have also (out of desperation) re-published and restarted the service and tried on a different service all with the same results. What is (clearly) incongruous here is that the full object can be read fine, but the embedded objects cannot. Presumably I am missing something OBVIOUS, but Ive tried re-writing a million times without success. Please help! Regards, Richard. I noticed this problem too. If i defined a dynamic layer in a method and than query some of its properties such as layerInfos rightway. i will get the similar error message. However, if i defined the layer in one method lile init(), and then query its properties in other method. It worked just fine. Strange is it ? Maybe it is a bug or maybe it is just dojo.Deferred. Would be interested to know...
... View more
03-10-2011
04:52 AM
|
0
|
0
|
1813
|
|
POST
|
Hi, I understood.I tried with all different spatialrelationships. Still it is not returning any fearure on querycomplete Have you tried executeRelationshipQuery method. It will give me all the relationships that you can try on. Or buffer the query point so that the intersection makes sense. Or try to use identify task for the point of line feature by giving some value of tolerance. Those are just some of the suggestions... Hope it will help you.
... View more
03-10-2011
04:01 AM
|
0
|
0
|
1587
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-11-2011 12:16 PM | |
| 1 | 05-25-2017 08:26 AM | |
| 1 | 06-02-2017 07:37 AM | |
| 1 | 06-28-2011 07:02 AM | |
| 1 | 06-12-2017 10:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-01-2024
09:57 PM
|