|
POST
|
But how to I pass that string to this variable? var operationalLayer = new esri.layers.ArcGISDynamicMapServiceLayer("string_goes_here"); Hi Don, Sorry, I misunderstood your question. What is the value of rest_url after you've sent it through your function? The syntax for specifying the URL parameter is shown here. The URL should be something like http://server/ArcGIS/rest/services/layername - see the Services Directory help file entry. Cheers, Steve
... View more
08-04-2011
05:03 PM
|
0
|
0
|
4815
|
|
POST
|
I can't test this (and I'm not an expert on regexp), but I think you might want to do something along these lines:
var fullUrl = window.location.href; //get the full URL
var layerUrl = gup(fullUrl); // send this to the function
console.log(layerUrl);// this should be just the layer definition section
function gup( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec(name);
if( results == null )
return "";
else
return results[1]; //return just the Layer definition of the URL
}
Good luck, Steve
... View more
08-04-2011
04:53 PM
|
0
|
0
|
4815
|
|
POST
|
Hi Heming, This looks like a good approach - I'll let you know how it goes. Thanks, Steve
... View more
08-04-2011
04:38 PM
|
0
|
0
|
2370
|
|
POST
|
function changeMap(layer) {
//hideImageTiledLayers(layer);
There's a comment before the hideImage function, so it doesn't actually run - could that be it?
... View more
08-04-2011
04:03 PM
|
0
|
0
|
1443
|
|
POST
|
I'm also experiencing a similar issue with an 'onclick' event not working correctly until the map has been moved Just to add that I've seen something like this too. In my case I'm running an IdentifyTask when the user clicks on the map. It works most of the time, but occasionally the click doesn't cause the task to run. I'll let you know if I can find the steps to reproduce it reliably.
... View more
08-04-2011
03:19 PM
|
0
|
0
|
2352
|
|
POST
|
Hi Derek, Background to this question - I'm trying to keep the UI really simple, so the user doesn't have to worry about typing in a query. A 2-handled dojo slider bar works really well for selecting features between a range, aside from the asynchronous query issue. Filtering on a feature layer may be an option here. I could also use a Submit button which runs the query, rather than running it onChange. Any other suggestions would be very welcome. Cheers, Steve
... View more
08-03-2011
03:25 PM
|
0
|
0
|
2370
|
|
POST
|
I've built a slider bar control which runs a QueryTask automatically on update - as soon as you release the slider's handle, the query executes. This works fine if the user waits for the QueryTask to finish before moving the slider again, but if they move the slider again quickly, there may be concurrent QueryTasks in operation. How can I destroy the first QueryTask when the second QueryTask starts? The QueryTask is called using an onChange event handler on the slider bar, which runs the line: searchQueryTask.execute(searchQuery, showSearchResults, errResults); (I've experimented with disabling the slider bar while the query is running, but this isn't ideal from a usability perspective) Thanks, Steve
... View more
08-02-2011
07:28 PM
|
0
|
9
|
4476
|
|
POST
|
query.where ="Upper(STATE_NAME) like '%" + stateName.toUpperCase() +"'%"; That works - thanks again.
... View more
08-01-2011
05:19 PM
|
0
|
0
|
2132
|
|
POST
|
What are the techniques recommended for handling case sensitivity in a query in the JS API? The Query No Map sample is a perfect example - search on "CALIFORNIA" and it returns no results. Is there a way to handle the situation where the user doesn't know the correct capitalisation required? function execute(stateName) {
query.text = stateName;
queryTask.execute(query,showResults);
} You could convert query.text to upper- or lower-case, but that doesn't help unless the actual value in the geodatabase matches. Is there a flag to ignore the case in a query? Thanks, Steve
... View more
07-28-2011
05:44 PM
|
0
|
6
|
5277
|
|
POST
|
it's a bug with the basemap gallery and bing layers Hooray, an actual bug rather than doing something wrong! No probs, I'll use the workaround for now. Thanks guys.
... View more
07-28-2011
05:01 PM
|
0
|
0
|
1538
|
|
POST
|
The reference for BasemapLayer says that it includes an opacity setting, however I'm having problems getting it to work. Using the sample here I add a setting to specify the opacity: function createBasemapGallery(){
//Manually create a list of basemaps to display
var basemaps = [];
var basemapRoad = new esri.dijit.Basemap({
layers: [new esri.dijit.BasemapLayer({
type: "BingMapsRoad",
opacity: 0.25
})],
id: "bmRoad",
title: "Road"
}); This doesn't have any discernible effect - what am I doing wrong? Cheers, Steve
... View more
07-27-2011
08:53 PM
|
0
|
7
|
2306
|
|
POST
|
AGS tries to protect you from regularly overwhelming services by setting the default max number of results to 1000 I guess I'm concerned about the possibility of someone trying SQL injection or similar, to try to overwhelm the server by running multiple large requests. Is preventing that beyond the scope of the JS API, and more in the realms of web security software? Have you changed this setting? No, but I'd be interested in knowing how to do so. In my case, more than about 20 results would be meaningless, so it would be great if I could have the server time-out as soon as this limit was reached. Thanks, Steve
... View more
07-27-2011
03:07 PM
|
0
|
0
|
1168
|
|
POST
|
The samples using the Query and Find tasks carefully manage the query, for example using a point for the query.geometry, or only allowing a known field to be searched. What are the best practices to avoid problems, when allowing the user to enter the query.where clause themselves? For example, the user might enter 1=1 or OBJECTID > 1, resulting in the query timing out (especially if the query is returning the geometry). One option could be to run QueryTask.executeForCount to ensure that no more than X features are returned - but even this requires the query to finish (or time out) before returning a count. Thanks, Steve
... View more
07-26-2011
09:18 PM
|
0
|
4
|
3446
|
|
POST
|
Using the IdentifyTask, is it possible to: 1) control which attributes will be returned? 2) show aliases instead of field names? As far as I can see, the IdentifyResults contain all attributes of the feature, and do not contain the aliases. I'm trying to make a generic Identify tool, which will work on all layers without hard-coding the attributes and aliases. For this to work, I need to be able to specify which attributes to display, and to access their aliases. Since IdentifyParameters can work across multiple layers, it doesn't have the option to specify which layers should be returned. Are there any options which would allow a generic Identify tool to work? Thanks, Steve
... View more
07-25-2011
04:03 PM
|
0
|
1
|
864
|
|
POST
|
<table data-dojo-type="dojox.grid.DataGrid" data-dojo-id="grid" id="grid" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'">
<thead>
<tr>
<th field="PARCELID">Parcel ID</th>
<th field="OWNERNME1" >Owner 1</th>
<th field="OWNERNME2">Owner 2</th>
<th field="RESYRBLT ">Year Built</th>
<th field="SITEADDRESS" width="100%">Address</th>
</tr>
</thead>
</table>
This is great - thanks for posting it. A comment on the samples in general is that they mostly contain hard-coded elements such as the table above. It would be great if you could post some examples which are more generic, so they can be used more easily. For example, rather than hard-coding the field names and aliases, build the table on-the-fly. Or perhaps post a sample "template" for a best-practices application. Cheers, Steve
... View more
07-22-2011
03:48 PM
|
0
|
0
|
1399
|
| 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
|