POST
|
Here is an example: app.kml=new KMLLayer({ url: "my file" }); app.map.add(app.kml); app.kml.load().then(function() { app.mapView.extent=app.kml.fullExtent; console.log(app.kml) }); It is live at: http://viseyes.org/visualeyes/test.htm?kml=https://www.arcgis.com/sharing/rest/content/items/a8efe6f4c12b462ebedc550de8c73e22/data The console prints out the KMLLayer object, and the fullExtent field seems to be not set right.
... View more
08-16-2019
07:39 AM
|
0
|
0
|
512
|
POST
|
Is there any way to calculate the extent of a KML layer loaded from the web using the KMLLayer({ url: "my file" }) method in ArcGIS Online? The KMLs loaded AGOL have a valid fullExtent property, but ones loaded from other sources seem to default to the entire world, which is not useful.
... View more
08-12-2019
07:48 AM
|
0
|
3
|
563
|
POST
|
Came up with a solution. Not as elegant as one would like (i.e. having to spec the class names directly), but it works. var reqs="esri/Map", "esri/WebMap", ... "esri/widgets/Legend";
require(app.reqs, function()
var Map, WebMap, MapView, SceneView, KMLLayer, ... Legend;
for (i=0;i<app.reqs.length;++i) {
key=app.reqs[i].match(/([^\/]+)$/i)[1];
if (key == "Map") Map=arguments[i];
else if (key == "WebMap") WebMap=arguments[i];
...
else if (key == "Legend") Legend=arguments[i];
}
... View more
08-11-2019
08:00 AM
|
0
|
1
|
541
|
POST
|
It is possible to dynamically decide which models to require()? It takes a while to load a bunch of widgets, using the JavaScript require() function, so I want to be able to only include the ones I'm using in any given instance to the ones I'm using. Currently, I do this: var reqs="esri/Map", "esri/WebMap", ... "esri/widgets/Legend"; require(reqs, function(Map, WebMap, ... ,Legend,) { ... It's easy enough to fill the reqs array, but how can I vary the names in the function?
... View more
08-10-2019
10:07 AM
|
0
|
2
|
649
|
POST
|
I am loading a Webmap made with ArcGIS online. I can get the center from map.portalItem.extent, but how do I find the zoom? app.map=new WebMap({ portalItem: { id: myId }}); app.map.load().then(function() { app.center[0]=app.map.portalItem.extent.center.longitude; app.center[1]=app.map.portalItem.extent.center.latitude; app.zoom=??? }); ... app.mapView.when(function() { app.activeView.goTo({ center:app.center, zoom: app.zoom }) });
... View more
08-08-2019
03:06 PM
|
0
|
0
|
414
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|