|
POST
|
Have you tried adding a remove to ensure there aren't duplicates from a higher level? <customHeaders>
<remove name="Access-Control-Allow-Origin" />
<add name="Access-Control-Allow-Credentials" value="true" />
<add name="Access-Control-Allow-Origin" value="http://sub.domain.com" />
</customHeaders>
... View more
08-13-2015
10:37 AM
|
1
|
2
|
4607
|
|
POST
|
Here is a JSFiddle sample that demonstrates how to do this. I'll paste the same code below in case something happens to the JSFiddle. <div id="map"></div>
<div class="layer-list">
<ul>
<li>
<input id="countyBoundariesCheckbox" type="checkbox" data-layer-id="County Boundaries" />
<label for="countyBoundariesCheckbox">County Boundaries</label>
</li>
</ul>
</div>
<div id="basemapGalleryContainer">
<div id="basemapGallery"></div>
</div> html, body {
height: 100%;
overflow-y: hidden;
}
html, body, #map, .map.container {
padding:0;
margin:0;
}
#map, .map.container {
height: calc(100% - 10em);
}
#basemapGalleryContainer {
height: 10em;
overflow-y: scroll;
}
.layer-list {
position: absolute;
right: 0;
top: 0;
z-index: 1;
padding: 0.5em;
background-color: RGBA(255, 255, 255, 0.75)
} require([
"esri/config",
"esri/map",
"esri/geometry/Extent",
"esri/dijit/BasemapGallery",
"esri/layers/ArcGISTiledMapServiceLayer"
], function (esriConfig, Map, Extent, BasemapGallery, ArcGISTiledMapServiceLayer) {
"use strict";
var map, basemapGallery, scalebar, wsdotBasemap, wsdotBasemapLayer;
esriConfig.defaults.io.corsEnabledServers.push("www.wsdot.wa.gov");
// Create the map, explicitly setting the LOD values.
map = new Map("map", {
extent: new Extent({
"xmin": -14058520.2360666,
"ymin": 5539437.0343901999,
"ymax": 6499798.1008670302,
"xmax": -12822768.6769759,
"spatialReference": {
"wkid": 3857
}
}),
lods: [
{"level": 0,"resolution": 56543.033928,"scale": 591657527.591555},
{"level": 1,"resolution": 78271.5169639999,"scale": 295828763.795777},
{"level": 2,"resolution": 39135.7584820001,"scale": 147914381.897889},
{"level": 3,"resolution": 19567.8792409999,"scale": 73957190.948944},
{"level": 4,"resolution": 9783.93962049996,"scale": 36978595.474472},
{"level": 5,"resolution": 4891.96981024998,"scale": 18489297.737236},
{"level": 6,"resolution": 2445.98490512499,"scale": 9244648.868618},
{"level": 7,"resolution": 1222.99245256249,"scale": 4622324.434309},
{"level": 8,"resolution": 611.49622628138,"scale": 2311162.217155},
{"level": 9,"resolution": 305.748113140558,"scale": 1155581.108577},
{"level": 10,"resolution": 152.874056570411, "scale": 577790.554289},
{"level": 11,"resolution": 76.4370282850732,"scale": 288895.0},
{"level": 12,"resolution": 38.2185141425366,"scale": 144447.638572},
{"level": 13,"resolution": 19.1092570712683,"scale": 72223.819286},
{"level": 14,"resolution": 9.55462853563415,"scale": 36111.909643},
{"level": 15,"resolution": 4.77731426794937,"scale": 18055.954822},
{"level": 16,"resolution": 2.38865713397468,"scale": 9027.977411},
{"level": 17,"resolution": 1.19432856685505,"scale": 4513.988705},
{"level": 18,"resolution": 0.597164283559817,"scale": 2256.994353},
{"level": 19,"resolution": 0.298582141647617,"scale": 1128.497176}
],
minZoom: 7,
maxZoom: 19
});
// Create the basemap gallery using basemaps defined in a WSDOT group.
basemapGallery = new BasemapGallery({
map: map,
basemapsGroup: {
id: "085a9cb0bb664d29bf62b731ccc4aa64"
},
basemapIds: map.layerIds
}, "basemapGallery");
basemapGallery.startup();
// When the basemap gallery loads, select the first basemap with
// the title "Imagery Hybrid". (There should be only one, but that's what
// the code is doing.)
basemapGallery.on("load", function() {
var basemap, basemaps = basemapGallery.basemaps.filter(function(basemap){
return basemap.title === "Imagery Hybrid";
});
if (basemaps && basemaps.length > 0) {
basemap = basemaps[0];
basemapGallery.select(basemap.id);
}
});
map.on("load", function(){
var toggleLayer = function() {
var layer = map.getLayer(this.dataset.layerId);
if (this.checked) {
layer.show();
} else {
layer.hide();
}
};
var checkbox = document.getElementById("countyBoundariesCheckbox");
map.addLayer(new ArcGISTiledMapServiceLayer("http://www.wsdot.wa.gov/geosvcs/ArcGIS/rest/services/Shared/CountyBoundaries/MapServer", {
id: "County Boundaries",
visible: checkbox.checked
}));
checkbox.onclick = toggleLayer;
});
});
... View more
07-27-2015
09:47 AM
|
3
|
2
|
1089
|
|
POST
|
Here are some Plunkr examples that show a full screen map. version 3.14 version 4.0beta1
... View more
07-24-2015
08:59 AM
|
0
|
0
|
6640
|
|
POST
|
I think I see what you are talking about with feature layers. Since they don't actually have sublayers, there is nothing to show in that div at the moment. (Ideally the legend for these layers would go here, but I haven't figured that part out yet.) The metadata feature requires an SOE we created to be installed on your ArcGIS Server, as ArcGIS Server doesn't expose this type of metadata on its own.
... View more
07-20-2015
12:07 PM
|
2
|
0
|
1995
|
|
POST
|
FYI, those links to ideas.arcgis.com don't work unless you've already logged into the site. http://ideas.arcgis.com/apex/ideaView?id=087300000008G6BAAU http://ideas.arcgis.com/apex/ideaSearchResults?s=javascript+toc&searchButton=search http://ideas.arcgis.com/apex/ideaView?id=087E00000004b8eIAA
... View more
07-20-2015
11:11 AM
|
0
|
1
|
2018
|
|
POST
|
-ability to alter transparency of each service -included legend -ability to move services up/down And gray out scale dependent layers beyond scale. [Looks like they're planning to add this feature] The layer list widget I created has those features. The code is in the public domain if anyone wants to incorporate it into the ArcGIS API's layer list. Esri's GitHub issues list would be a good place to request features.
... View more
07-16-2015
11:54 AM
|
2
|
2
|
1995
|
|
POST
|
Not sure if it works with the 4.0 beta version, though.
... View more
06-30-2015
10:55 AM
|
1
|
1
|
1898
|
|
POST
|
Have you tried esrislurp? I haven't used it myself but it seems to be designed for what you are trying to do.
... View more
06-30-2015
10:54 AM
|
0
|
2
|
1898
|
|
POST
|
This isn't the right forum for this question. Try this one: Geodatabase
... View more
06-25-2015
02:20 PM
|
0
|
0
|
1298
|
|
POST
|
You can manually edit the JSON configuration files for items published on ArcGIS Online using ArcGIS Online Assistant.
... View more
06-12-2015
04:03 PM
|
1
|
1
|
1123
|
|
POST
|
If you don't mind combining all three boxes' functionality into a single box, you could use the Search widget.
... View more
06-08-2015
08:38 AM
|
0
|
0
|
1545
|
|
POST
|
There is a library called turf that is supposed to allow you to do this. (Note that I haven't tried it myself, though.) Since turf uses GeoJSON, you can use Terraformer to convert from ArcGIS geometries to GeoJSON.
... View more
06-03-2015
05:25 PM
|
1
|
0
|
5197
|
|
POST
|
I am able to reproduce what you are describing. However, if you either click on the suggestion in the list, or push the down arrow to select the suggestion and then press Enter, it will take you to the correct location. Someone at Esri would need to tell you if this is a bug or not.
... View more
05-19-2015
05:30 PM
|
0
|
0
|
1693
|
|
POST
|
"I can't post a jsFiddle with external file resources..." FYI, Plunker will let you do this.
... View more
05-14-2015
08:59 AM
|
0
|
0
|
687
|
|
POST
|
Esri-Leaflet (an extension of Leaflet) has not been around as long and does not have as many capabilities as the ArcGIS API for JavaScript at the moment. However, Leaflet is a lot more lightweight (i.e., fewer HTTP requests) than ArcGIS API for JS. Which one you use would depend on what your application needs to do. If you used JavaScript but never used Dojo before, Leaflet will probably be easier to learn.
... View more
04-22-2015
08:53 AM
|
1
|
0
|
1465
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-08-2025 08:56 AM | |
| 2 | 03-05-2024 05:10 PM | |
| 1 | 04-30-2013 08:23 AM | |
| 1 | 05-03-2022 09:45 AM | |
| 1 | 06-30-2015 10:55 AM |