|
POST
|
I think I must be missing something very basic here, but all I want to do is have toggle working for map services. When the checkbox is checked, show the layer and when the checkbox is unchecked, hide the layer. The showing the layer bit works, but the hide does not. I've tried a lot of different methods and the only one that works is removeAllLayers()? function visibleDPLayers() {
var DPlayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://gis.mstn.govt.nz/ArcGIS/rest/services/DistrictPlan/MapServer");
map.addLayer(DPlayer);
if (legend.DPCheckbox.checked == true) {
alert ('show')
DPlayer.show();
}
else {
alert ('hide')
DPlayer.hide();
}
} Yes your logic is a little scrambled (mixing visibility and adding layer). I would suggest having 2 functions, an add layer function and a toggle visibility function. Otherwise you will be adding your layer over and over so function visibleDPLayers() {
var DPlayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://gis.mstn.govt.nz/ArcGIS/rest/services/DistrictPlan/MapServer");
map.addLayer(DPlayer); called from your init and then an onClick(toggleVis) function function toggleVis(){
if (legend.DPCheckbox.checked == true) {
alert ('show')
DPlayer.show();
}
else {
alert ('hide')
DPlayer.hide();
}
}
... View more
11-09-2011
03:55 AM
|
0
|
0
|
960
|
|
POST
|
They only difference I can see is there are running 10.02 and you are running 10. As for the result, its because the score on the NE is higher, but I cannot tell you why (in my opinion it shouldnt be). That is a question for the ESRI geocoder voodoo folks.
... View more
11-07-2011
09:17 AM
|
0
|
0
|
946
|
|
POST
|
There isn't - but we are looking at adding events to the IdentityManager. "Is there an onSuccessLogin type event that i can listen for to trigger my refresh" Ok thanks for the info, that would be great. Basically I loop through a list of layers and use the map.addLayer method. If one is secure, it prompts, but the others continue to load. Its seems like, however, that after my credentials pass the onLayerAdd event has already passed.
... View more
11-07-2011
09:15 AM
|
0
|
0
|
777
|
|
POST
|
Sorry I was not aware of the IP Address being internal only, I am learnuing new things every day, thanks for pointing that out. I have now updated the page with what I think is the external IP address but I am still getting 0 resuts from the API: http://northmiamicra.org/geoCodeMyLocator.html And the rest service should now be visible for you here, it is returning 466 candidates: http://209.149.254.202/ArcGIS_External/rest/services/MDStreets_NoOpaLocka/GeocodeServer/findAddressCandidates?Street=&City=&State=&ZIP=&Single+Line+Input=776+ne+125+st&outFields=&outSR=&f=html Your parameter is wrong. you need to change it to var address = {"Single Line Input":dojo.byId("address").value}; instead of SingleInput
... View more
11-07-2011
08:26 AM
|
0
|
0
|
946
|
|
POST
|
I have taken the sample code for geocoding that I found here: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/locator_address.html And tried to get it to work with my own geocoder. The only code that I have changed is the URL to my geocoder service, and the default address in the textbox, I also added a message box to display the number of candidates returned (for debugging). For some reason, when I try to use my geocoder service it returns 0 candidates: http://northmiamicra.org/geoCodeMyLocator.html Even though it does return plenty of candidates if I just call the geocode service from rest: http://192.168.110.10/ArcGIS_External/rest/services/MDStreets_NoOpaLocka/GeocodeServer/findAddressCandidates?Street=&City=&State=&ZIP=&Single+Line+Input=776+ne+125+st&outFields=&outSR=&f=html Any idea what the problem may be? Could it be something to with some sort of caching? Because originally there was something wrong with the locator that i was using and I had to replace it with a new one. I have stopped and restarted the service and it is now working in the REST web interface but is still not working when called from the API. I can't view your rest service, its an internal address (192.168). My guess is this is the same problem your app is having, it cant see the geocoder. If you had a format problem , you should at least get an error response. I get "aborted"
... View more
11-07-2011
06:45 AM
|
0
|
0
|
946
|
|
POST
|
Hi, I am seeing weird issues when viewing apps in IE 9. Issues are listed below. #1. Cannot see the feature layer (comes from FeatureServer). #2. Cannot see the overview map. #3. Cannot see the polygon drawn by esri.toolbars.draw.We are using freehand polygon.Polygon is actually drawn because intersecting features are selected.However,I can't see the polygon. I searched a lot on the forum but could not find anything specific.We are using version 2.5 for the API. I tested these things in IE 10 beta, every thing except #2 works fine. Any help is much appreciated. I have not seen this behavior. Do you have a public site I could test against here?
... View more
11-07-2011
03:40 AM
|
0
|
0
|
321
|
|
POST
|
Kelly, Thank you so much, this has worked perfectly for me. I load my layers, and if it hits a secure layer it prompts excellently. My only problem is i do something after the layers load, and since it is all asynchronous, the delay of logging in is making me miss my event. I do it onLayerAdd, it doesn't seem that this event is being fired after a layer is loaded that includes a challenge from the identity manager. Is there an onSuccessLogin type event that i can listen for to trigger my refresh (its for a TOC legend).
... View more
11-05-2011
05:56 PM
|
0
|
0
|
777
|
|
POST
|
I have an app that uses secure services. I use the identity manager to login and it works great. Part of the site builds a toc that uses the rest legends via separate calls (i loop through all the this.map.getLayer(layerId).url and make an dojo.xhrGet to the /MapServer/legend?f=json but i need to append the token on it, which i never see. How do I get access to it? If i used esri.request instead of dojo.xhrGet would it put the token on?
... View more
11-04-2011
12:52 PM
|
0
|
5
|
2263
|
|
POST
|
How would I have known that this was JSON other than more experience and someone pointing it out to me? Ok, so, testVals ends up looking like this: {name:residential, name:industrial, etc} or {residential:true, industrial:true, etc} then the array: values = [{"name:residential"},{name:industrial}] and how does it sort (add them in order)? JSON is {} with key value pairs. It is just an object with some formatting (JavaScript Object Notation). testVals = {"residential":true, "industrial":true} is correct. Note that json is unsorted, so to retrieve the value you would say testVals.residential (which would return the boolean true in this case) values is an array , and the push method adds values to the end as it loops through. (unshift would add to the beginning) so values[0] would return JSON of {"residential":true} so values[0].residential = true and values[1].industrial = true
... View more
11-04-2011
12:46 PM
|
0
|
0
|
583
|
|
POST
|
I have questions about the code below. It is part of this example: I added comments/questions in for myself. var testVals={}; // create object literal (shortcut to creating a new object). This is to hold name:value pairs because an array can only hold single values?
var features = results.features; //features is a property of query task and has the type of 'graphic'. It is an array.
dojo.forEach (features, function(feature) { //optimized way of doing a for loop, specific to dojo, patterned after HTML5. Let's you apply a function to each element of an array. Feature is each item in the array.
zone = feature.attributes.ZONING_TYPE; //feature in this context is a graphic and attributes is a property
if (!testVals[zone]) { //tests to see if the name:value pair exists
testVals[zone] = true; //if it it doesn't exist then set this object to true?
values.push({name:zone}); //push the name:pair of name:<value of zoning type> into the object literal
} So, if zone has a value of 'residential' then when it gets tested in the if statement, is it testing to see if that value is contained in the testval object? Is it saying, "if zone value does not exist then set that value to true? I'm not exactly sure what exactly is getting set to true and why? Then, it pushes that value into the testval object using name:zone as the pair. almost All your comments are correct, except the last two lines Since testVals is JSON, and not an array testVals[zone] = true actually creates a key "zone" with value true values.push({name:zone}); (you left out the var values=[]; ) pushes the json pair into an array so you now have 2 variables, one with json values unsorted, and an array with the json pairs added in order.
... View more
11-04-2011
10:56 AM
|
0
|
0
|
583
|
|
POST
|
I agree, but even your initial description is not correct. A layer is NOT a discrete data set, a shapefile, a layer in a geodatabase or something . Those are tables, feature classes, etc. A layer is a Feature Class,etc. with its associated symbology. If you look at it this way, the AGS api makes more sense, but not completely. They intermix the term layer for both a map service (mxd/msd) and its component sublayers as both generically layers. And to add to that, if a map service is cached, its a single layer according to the application. It is only the dynamic services that have sublayers that you can interact with.
... View more
11-04-2011
05:14 AM
|
0
|
0
|
880
|
|
POST
|
I would just like to say thanks for this. I have it 90% integrated in my app and it works amazingly. A thought, like your TOC code, would it be possible to hide radio buttons at a scale if they are not available? thanks again.
... View more
10-28-2011
01:00 PM
|
0
|
0
|
391
|
|
POST
|
In my basemap layer labels are created in form of annotation layers. I want to show the Legend without the annotation layers , it looks weird when Annotation layer and a black dot for annotation layers shows up in the legend. Is is possible to declare legend for only specific layers? Unfortuantely not at the moment. If you use the layerInfos parameter you could specify all layers except that one. It would be nice if there was a layersToExclude paramter.
... View more
10-17-2011
08:14 AM
|
0
|
0
|
366
|
|
POST
|
Kelly, I have this working nearly perfectly using the sample provided, however, does it not support graphics? If i can get the graphics fixed, it would be a huge milestone for us.
... View more
10-17-2011
06:19 AM
|
0
|
0
|
828
|
|
POST
|
Unfortunately we do not have a Code Assist plug-in for any version of the API that works with Aptana Studio 3. At version 3, Aptana changed the way Code Assist works and there have been some technical challenges with building Code Assist for version 3. We are working to resolve these issues and hope to have an update soon. Thanks for the update Kelly. Is there any plans to support Netbeans? It is very popular.
... View more
10-17-2011
04:55 AM
|
0
|
0
|
1459
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-22-2014 08:35 AM | |
| 1 | 05-02-2012 04:56 AM | |
| 1 | 10-29-2021 07:40 AM | |
| 1 | 10-28-2021 05:26 AM | |
| 1 | 07-17-2012 08:48 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-01-2022
02:00 PM
|