|
POST
|
It resides in a file: { 'Lyrname' : [ {"lname": "parcelsLayer", "ltitle": "Parcels", "lUrl": "http://fwb-gissrv/ArcGIS/rest/services/Maps/Parcels/MapServer", "lVisb": "false", "lyid": "parcelsaa"}, {"lname": "parcelsarLayer", "ltitle": "Parcels Aerial", "lUrl": "http://fwb-gissrv/ArcGIS/rest/services/Maps/ParcelsAerial/MapServer", "lVisb": "true", "lyid": "parcelsab"}, {"lname": "hydroLayer", "ltitle": "Hydrography", "lUrl": "http://fwb-gissrv/ArcGIS/rest/services/Maps/Hydrography/MapServer", "lVisb": "true", "lyid": "hydro"}, {"lname": "bfpLayer", "ltitle": "Building Footprints", "lUrl": "http://fwb-gissrv/ArcGIS/rest/services/Maps/BFP/MapServer", "lVisb": "true", "lyid": "bfpa"} ] }
... View more
09-11-2012
09:51 AM
|
0
|
0
|
1993
|
|
POST
|
Is anyone familiar with loading layers from a config file? I am trying to do it and I get various results depending upon the method I try. The method quoted gives me duplicate entries of each layer added. I have created the array called layrnames, but cannot determine proper function to use to load all the layers names I have pushed into the array. Any help would be greatly appreciated 🙂 Thanks, Luci function init(){ esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://fwb-gissrv/ArcGIS/rest/services/Geometry/GeometryServer"); //create popup for multiple popups var popup = new esri.dijit.Popup({ fillSymbol: new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2), new dojo.Color([240, 128, 128, 0.25])) }, dojo.create("div")); //map.spatialReference = new esri.SpatialReference({wkid:102100}); //set initial extent var initExtent = new esri.geometry.Extent(-9651200, 3555500, -9636400, 3562470, new esri.SpatialReference({ "wkid": 102100 })); locator = new esri.tasks.Locator("http://fwb-gissrv/ArcGIS/rest/services/GeoCodes/AddressessFWB/GeocodeServer"); dojo.connect(locator, "onAddressToLocationsComplete", showResultsl); //load map map = new esri.Map("map", { extent: initExtent, slider: true, lods: lods, infoWindow: popup }); //add basemap gallery tiles createBasemapGallery(); dojo.connect(basemapGallery, "onError", function(msg){ console.log(msg) }); dojo.xhrGet({ url: "Config.json", handleAs: "json", preventCache: true, load: function(responseObject, ioArgs){ layrname = responseObject.Lyrname; //add layers from config file if (layrname.length != 0) { for (var i = 0; i < layrname.length; i++) { layname = (layrname.lname); laytitle = (layrname.ltitle); layurl = (layrname.lUrl); layrvis = (layrname.lVisb); layid = (layrname.lyid); layname = new esri.layers.ArcGISDynamicMapServiceLayer(layurl, { id: layid, visible: layrvis }); legendLayers.push({ layer: layname, title: laytitle }); layrnames.push({ layern: layname }); map.addLayer(layname); } }; dojo.connect(map, 'onLayeraddResult', function(results){ var legend = new esri.dijit.Legend({ map: map, layerInfos: legendLayers }, "legendDiv"); legend.startup(); }); //map.addLayers([layname]); dojo.connect(map, 'onLayerAddResult', function(results){ //add check boxes dojo.forEach(legendLayers, function(layer){ var layerName = layer.title; var checkBox = new dijit.form.CheckBox({ name: "checkBox" + layer.layer.id, value: layer.layer.id, checked: layer.layer.visible, onChange: function(evt){ var clayer = map.getLayer(this.value); clayer.setVisibility(!clayer.visible); this.checked = clayer.visible; legend.refresh(); } }); //add the check box and label to the toc dojo.place(checkBox.domNode, dojo.byId("toggle"), "after"); var checkLabel = dojo.create('label', { 'for': checkBox.name, innerHTML: layerName }, checkBox.domNode, "after"); dojo.place("<br />", checkLabel, "after"); }); }); } });
... View more
09-11-2012
07:23 AM
|
0
|
17
|
4240
|
|
POST
|
Okay. What is the difference between the above 2 methods? In the first, everything is fine. The dynamic layers (wkid 2238) seem to be reprojecting on the fly just fine. Using the second method, my dynamic layers do not project on the fly and are in Africa instead of Florida. Thanks! Luci
... View more
07-05-2012
11:47 AM
|
0
|
0
|
537
|
|
POST
|
Hi All, I have been playing around with trying to load data from a config.txt file I am using the Basemap Gallery for my background maps and I am also loading several dynamic map service layers. It seemed as though the projection was being set from the first feature layer loaded and not the first basemap loaded. But, upon investigation it seems as though I am getting different projections based upon the method used to set the map extent. Can someone explain to me what the difference is between the two methods below because when I use Method 1 everything lines up properly, but, when I use Method 2 my Basemaps are fine, but my dynamic feature layers are over in Africa... Method 1: All of the below is in my default.html file var initExtent = new esri.geometry.Extent({"xmin":-9654356.83267948,"ymin":3553252.14612359,"xmax":-9631845.86180353,"ymax":3569377.06341259,"spatialReference":{"wkid":102100}}); map = new esri.Map("map", { extent: initExtent, slider: true, lods: lods, infoWindow: popup }); Method 2: This is config.txt { 'DefaultExtent' : "-9654356.83267948, 3553252.14612359, -9631845.86180353, 3569377.06341259" } This is in my default.html file var mapExtent = responseObject.DefaultExtent; var mapExtent2 = mapExtent.split(','); map = new esri.Map("map", { slider: true, lods: lods, infoWindow: popup }); map.setExtent(new esri.geometry.Extent(parseFloat(mapExtent2[0]), parseFloat(mapExtent2[1]), parseFloat(mapExtent2[2]), parseFloat(mapExtent2[3]), new esri.SpatialReference({ wkid: 102100 }))); Thanks, Luci
... View more
07-03-2012
05:32 AM
|
0
|
3
|
909
|
|
POST
|
Hi hzhu, Can you give an example of the code? I am new to javascript and am experiencing the same problem as Kirk. Thanks, Luci
... View more
06-22-2012
06:59 AM
|
0
|
0
|
2604
|
|
POST
|
I am loading 5 maps using the Basemap Gallery, then I am loading 15 dynamic layers. Switching basemaps performs as expected. All seems to work properly until you look closely at the first dynamic layer added. It cannot be turned off. It is like it is loaded as a basemap. I have rearranged the order of the dynamic layers and the first one added is always the one you cannot turn off. Anyone else experiencing this? Thanks, Luci
... View more
06-22-2012
06:54 AM
|
0
|
0
|
710
|
|
POST
|
Hi Keith, I had the same problem and then I realized that both were calling for different functions that unfortunately had the same name - showResults I changed the name of my Locator Function to showResultsl and changed it where it is called out in line below dojo.connect(locator, "onAddressToLocationsComplete", showResultsl); Now they are both working! Hope this helps, Luci
... View more
06-19-2012
07:06 AM
|
0
|
0
|
290
|
|
POST
|
dbecker88, I followed an URL on the gis.stackexchange website you quoted - http://jsfiddle.net/blordcastillo/mULcz/ - to be specific. The code was easily adaptable to my needs! Thanks, Luci
... View more
05-16-2012
10:56 AM
|
0
|
0
|
1034
|
|
POST
|
I would like to know if it is possible to click on the map, it searches 5px and returns all the items in that vicinity even if they are on different dynamic map service layers. We are currently using an enhanced identify widget in our Flex app but would like to know if it is possible in our HTML5 version that we are working on. I have successfully setup the identify task sample to use one of my dynamic map services to return an infoWindow if an item is on one of its layers and within a certain distance of the mouse click. So I have a basic understanding of the javascript version. I would just like it to apply to all dynamic map services instead of just one. Thanks, Luci
... View more
05-08-2012
12:36 PM
|
0
|
4
|
5101
|
|
POST
|
I am using the basemapgallery, a legend, and a TOC. Everything is working fine except for the very first dynamicmapservicelayer that I add using map.addLayer.(layername); is staying on TOP of all of the other layers and will not change visibility when I use the checkbox in the TOC. I am not using any featurelayers. I want to be able to turn on/off all dynamic layers. Is this a bug? I have 4 dynamic layers loading using syntax like: var layernameLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://...../Mapserver", {visible:true} map.addLayer(layernameLayer); I removed the map.addLayer(layernameLayer); after each one and combined them into: map.addLayers([layernameLayer, layernameLayer, etc.]); Now, none of the four layers can be set to on/off in TOC. baffling! I take that back, still the first one listed is the only one on TOP that cannot be set to visibility:false. Thanks, Luci
... View more
05-08-2012
09:22 AM
|
0
|
0
|
510
|
|
POST
|
I tried using basemapGallery.select(id); and could not obtain the desired results, so I ended up using LODs and adding my default basemap first in the list.
... View more
05-08-2012
09:04 AM
|
0
|
0
|
312
|
|
POST
|
I am using BasemapGallery. Is there any way to set the "visibility" of the basemaps? I want to load a basemap so that it will set the LODs, but I do not want it to be the default basemap that is visible to users, I want to use one of the other basemaps. Thanks, Luci
... View more
05-04-2012
09:41 AM
|
0
|
1
|
648
|
|
POST
|
The problem went away after I cleared the Rest cache. It will sometimes take a bit longer than usual but I am attributing that to the entire system being bogged down by users. Thanks Luci
... View more
04-24-2012
01:04 PM
|
0
|
0
|
2131
|
|
POST
|
I have it working now. I have a virtual directory pointing to the folder containing all of our documents and I created another field "HyperlinkA" in all of our features that has "forwardslash" instead of "backslash" because the IOS device didn't know what to do with them. The Android device could use the "backslash" just fine though. I am using the following syntax in my JSON files: "description": null, "showAttachments": true, "mediaInfos": [{ "title": "", "type": "image", "caption": "http://fwb-gissrv/documents/{HyperlinkA}", "value": { "sourceURL": "http://fwb-gissrv/fwb/assets/images/hyperlink.png", "linkURL": "http://fwb-gissrv/documents/{HyperlinkA}" } }] Thanks, Luci
... View more
04-24-2012
12:59 PM
|
0
|
0
|
767
|
|
POST
|
Ok, I believe I have the syntax correct. I copied some of our PDF files out to the intranet webserver and have directory browsing enabled. I am using http:// instead of the UNC. If I go to a browser on the Android or IOS device I can browse the directory and open the PDF files so I know they are accessible. Now, when I start ArcGIS and I open the map I do not receive any error and everything displays properly. I zoom in and click on the feature, it retrieves the location and I select the > to view the popup information. I scroll down to where the hyperlink should be on the popup and I see the title and the caption and a busy icon in the middle that just spins and spins and spins. When I click on the spinning icon it takes me to another view and the busy spinning icon just spins and spins and spins. It is like ArcGIS does not know what to do with the PDF. Is it even capable of viewing a PDF? The largest PDF file we have is around 64 KB. "description": null, "showAttachments": false, "mediaInfos": [{ "title": "test", "type": "image", "caption": "Inlet Report", "value": { "sourceURL": "http:////fwb-gissrv/stormwater//{Hyperlink}", "linkURL": "http:////fwb-gissrv/stormwater//{Hyperlink}" } }] Any suggestions? Thanks, Luci Duh... Jared already told me Hyperlinks do not work on the Samsung Galaxy Tab - Argh!
... View more
03-07-2012
02:51 AM
|
0
|
0
|
767
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-04-2023 06:49 AM | |
| 1 | 09-29-2014 01:05 PM | |
| 1 | 11-30-2015 10:09 AM | |
| 1 | 02-09-2015 01:56 PM | |
| 1 | 12-30-2014 05:51 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-04-2023
10:56 PM
|