|
POST
|
I'm creating a featureLayer based on a featureCollection, as described at http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/featurelayer.html#FeatureLayer/FeatureLayerConst2 This page notes that a featureLayer based on a featureCollection has certain restrictions, compared to a "full" featureLayer. Does this featureLayer support onMouseOver access to the graphics, as described under GraphicsLayer onMouseOver, which states: The returned object contains screenPoint, mapPoint, and Graphic. I'm finding that the evt object does not contain access to the graphic, as shown in this example script, which builds up a featureLayer based on a query which creates a featureCollection. Put a breakpoint on line 77, hover over the purple polygon and note that evt.graphic does not exist. Any easy workarounds to get access to the graphic at this point? I just need to know its OID. Thanks, Steve
... View more
03-14-2013
10:06 PM
|
0
|
1
|
1051
|
|
POST
|
When I zoom out to a world view, the map doesn't fill the width of the screen. Ideally I'd like it to repeat until the available space is filled. How can I do this? To my knowledge, this isn't possible in the Esri JS API. At the developer summit 2 years ago, Jeremy mentioned that they didn't like the way Google Maps shows "multiple worlds" and that Esri approached it differently. (As an aside, I just noticed that Google Maps is no longer showing "multiple worlds" either.) wraparound180 will mean that you can pan continuously east or west, but if you zoom out too far you'll see white space. A workaround is to prevent zooming out too far by specifying the Level of Details (LODs).
... View more
03-13-2013
08:58 PM
|
0
|
0
|
2767
|
|
POST
|
What fires the dojo.connect (I assumed that "onComplete" meant that it executes when the map has drawn its initial contents)? And what does dojo.connect connect? dojo.connect is a listener meaning that it will sit there idle, until the event for which it is waiting occurs. In this case, he event for which it's waiting is the on-complete event of the queryTask (queryTaskBldg) - see the Events section of QueryTask. So, the dojo.connect "fires" once the query task has completed.
... View more
03-12-2013
07:09 PM
|
0
|
0
|
1307
|
|
POST
|
You may also need to specify the fields to be included in the feature layer definition. see http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/featurelayer.html#FeatureLayer/FeatureLayer1 which implies that only the OBJECTID field will be returned if you don't include a list of fields. Try adding:
options: {
id: "Cable",
title: "Cable",
opacity: 1.0,
visible: true,
outFields: ["*"],
infoTemplate: new esri.InfoTemplate("Attributes", "${*}"),
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT
}
... View more
03-12-2013
02:29 PM
|
0
|
0
|
528
|
|
POST
|
It seems to me that the graphics layer approach of the sample should be fine; we don't have ArcSDE (yet) for the feature layer approach You don't need ArcSDE to use a featureLayer - this is supported when using a file geodatabase. See the feature layer hover sample for an example of hovering over a feature to obtain information, without needing to run a query. The advantage to this approach is that you vastly reduce the amount of traffic/server requests, and you'll also see better performance as the attributes are already present on the client. Steve
... View more
03-11-2013
03:08 PM
|
0
|
0
|
1307
|
|
POST
|
I can post the full code if this is going to be of any help. Hi Denis, That would definitely help - or a link to the live site somewhere. Cheers, Steve
... View more
03-05-2013
06:43 PM
|
0
|
0
|
664
|
|
POST
|
See the VE Tiled Layer help file entry (Virtual Earth is the old name for Bing Maps and the class name hasn't changed)
... View more
03-05-2013
12:53 PM
|
0
|
0
|
771
|
|
POST
|
Can anyone point me to a sample/live site containing the ArcGIS Server Data Interoperability Extension so I can get a feel for how well it works, and integrates with an existing site? Thanks, Steve
... View more
02-24-2013
08:03 PM
|
0
|
0
|
658
|
|
POST
|
Hi Rahul, So you could attach a listener to the draw toolbar, and pop up a text-input object to ask for the text input, then symbolise it with a textSymbol. Cool. Thanks for the tip, Steve
... View more
02-22-2013
11:30 AM
|
0
|
0
|
1100
|
|
POST
|
The draw toolbar allows the user to create points, lines and polygons, which can be added to the map as graphic objects. Is there a similar mechanism to create free text? This would be similar to the Draw toolbar in ArcMap, which has an option to add labels. Thanks, Steve
... View more
02-22-2013
02:04 AM
|
0
|
3
|
1563
|
|
POST
|
I'd like something along the lines of the Verify option in ArcMap's Select By Attributes dialog: [ATTACH=CONFIG]22065[/ATTACH] This validates the statement before attempting to execute it. Cheers, Steve
... View more
02-21-2013
06:21 PM
|
0
|
0
|
1720
|
|
POST
|
Are you stuck with just using the ESRI REST API, can you create your own validate service and call that. Hi Harold, Are you aware of any examples of this? Cheers, Steve
... View more
02-21-2013
05:46 PM
|
0
|
0
|
1720
|
|
POST
|
What are the best options to check whether a query's where statement is valid? Some ideas are: - use regex or otherwise write a function to manually validate the SQL. A drawback is that the syntax of the query.where statement may be Esri-specific (eg % vs * depending on the dataset type, etc). Also, this will not verify that the statement will actually work - it may be valid SQL but not applicable to this layer. - run the query, and use the execute statement's error callback. The problem is that you won't know until afterwards whether it was a valid statement. - use executeForIds and specify a known ID in conjunction with the error callback. The problem is that I won't know a valid ID at runtime. - use executeForCount to return the number of records. The problem is that for a large dataset, the executeForCount still has to find all resulting features, which can take a while. It would be nice to have another option (eg QueryTask.validate) on the QueryTask, to verify that the query.where statement is valid. Another approach could be for Esri to add an option on executeForCount to break after the first feature is found (rather than waiting until all features have been found). Any other suggestions? Thanks, Steve
... View more
02-20-2013
06:46 PM
|
0
|
5
|
2224
|
|
POST
|
To get started, I'd suggest you install Firefox and Firebug and spend some time playing around with the developer tools. Learn how to put a breakpoint into code and inspect what's happening. Then add a listener for the onExtentChange event so you can see what happens when your map's extent changes. Inside this function, put some logic which ensures that the user hasn't moved outside your study area - if they have, move the map back again.
... View more
02-20-2013
12:28 PM
|
0
|
0
|
1704
|
|
POST
|
I seem to have answered my own question, which is that a featureLayer based on a featureCollection does support query by objectID. Read on if you're interested in verifying this..... Sample code here - it's pretty rough, with no error checking, but here's how to demonstrate that it works: - an empty featureLayer is created when the map loads - hit the Find button at the top left of the map - any lakes with a name starting with "LAKE CR%" will be added to the feature layer - these are shown in pink on the map, and their ObjectIDs are written to the firebug console - make a note of one of the ObjectIds and enter it into the text box at the top left - hit the Query ObjectId button and see the results in the console If you use the Find button again, it deletes the existing features and re-adds new features, which have incremented ObjectIds. In my other code, I'm finding that in this case the queryFeatures function is not finding the new features (eg where objectId = 14). Since it's working correctly here, my "sporadic" problems must lie elsewhere in my code. Cheers, Steve Update: in my other code, I was only passing a single ObjectID object, rather than an array of [ObjectIds] as required. Strangely, this worked some of the time.
... View more
02-19-2013
03:04 PM
|
0
|
0
|
1351
|
| 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
|