|
POST
|
Actually, I was incorrect... it's this bit of code that's preventing the KML from rendering: kml.on("load", function() {
domStyle.set("loading", "display", "none");
}); But, you can still set-up the basemap in the map constructor as an alternative way to show the topo layer. If you are curious, here's how it would look: map = new Map("map", {
basemap: "topo"
}); Many ways to skin a cat in the ArcGIS JSAPI! A Pen by Captain Anonymous - Forked
... View more
07-29-2015
05:58 AM
|
1
|
3
|
2179
|
|
POST
|
Jeremy, Try setting your basemap in the map's constructor. That's one way to solve it!
... View more
07-29-2015
05:55 AM
|
0
|
4
|
2179
|
|
POST
|
The legend will not render for me as a KML. I couldn't find a working sample, either - I even tried a few versions back in the API. Unless someone can find a working sample, I'm inclined to believe there may be a bug in the API as you've followed the instructions given by Esri, and the legend works when using the map service, but not the KML.
... View more
07-29-2015
05:50 AM
|
1
|
1
|
2782
|
|
POST
|
Kayla, I tried adding some map dbl-click events for the following sample: ArcGIS API for JavaScript Sandbox Using IE11, the double-click returns an object when double-clicking on the graphics. It works well when changing edit modes as well (right-clicking on the graphic will change the edit mode). Do you have a compatibility meta tag set anywhere? That has lead to problems for users, including myself, in the past.
... View more
07-28-2015
02:50 PM
|
0
|
1
|
2164
|
|
POST
|
Do you have any more details? Have you tried running a web debugger like Fiddler to see if there are any communication errors (Fiddler free web debugging proxy) or any errors in the browsers' dev tools/console (Chrome DevTools Overview - Google Chrome )?
... View more
07-28-2015
02:32 PM
|
0
|
0
|
571
|
|
POST
|
Amanda, You could try the sinusoidal projection, aka the Sanson–Flamsteed or the Mercator equal-area projection. This would work well for Africa. Sinusoidal projection - Wikipedia, the free encyclopedia You may also find it helpful to learn more about coordinate systems, projections, and datums - these can be tricky to understand and are often dry topics, unless you find them interesting! But, it helps nevertheless to understand them: What are map projections?—Help | ArcGIS for Desktop http://web.gps.caltech.edu/gislab/HowTo/ESRI%20-%20Map%20Projections.pdf
... View more
07-28-2015
10:54 AM
|
1
|
0
|
4641
|
|
POST
|
Ok, I flipped some settings on the server - I can get my KML to render. I tried yours again and see it: I can get the legend to render with the map service: KML layers should be supported... I'm still not sure why it wouldn't show for the KML. I started debugging the legend.js API file and didn't hit key spots that would construct the legend, but there wasn't a clear, obvious reason why. Perhaps it's a bug in the API? Are there any examples showing this working? I couldn't find one...
... View more
07-28-2015
08:41 AM
|
1
|
3
|
2782
|
|
POST
|
I tried pulling the kmz for review - unfortunately, I was unable to display even the kml using the ArcGIS JSAPI - here's the kml layer: <?xml version="1.0" encoding="UTF-8"?>
<kml xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://www.opengis.net/kml/2.2"> <NetworkLink>
<open>1</open>
<name>energia/impianti_biogas</name>
<LookAt>
<longitude>8.108852411473544</longitude>
<latitude>45.22470127132088</latitude>
<range>144615.2385434366</range>
</LookAt>
<Region>
<LatLonBox>
<north>45.61570041822</north>
<south>44.32799635241058</south>
<east>8.883711491697333</east>
<west>7.338359921523349</west>
</LatLonBox>
<Lod>
<minLodPixels>128</minLodPixels>
<maxLodPixels>-1</maxLodPixels>
</Lod>
</Region>
<Link>
<viewRefreshMode>onStop</viewRefreshMode>
<viewRefreshTime>2</viewRefreshTime>
<href>http://webgis.arpa.piemonte.it/ags101free/rest/services/energia/impianti_biogas/MapServer/export</href>
<viewFormat>
f=kmz&bboxSR=4326&imageSR=4326&format=png24&transparent=true&bbox=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]&size=[horizPixels],[vertPixels]&
</viewFormat>
</Link>
</NetworkLink>
</kml> I tried pulling some of my own map services this way and received something similar... I wonder if we need to flip a flag on the server...
... View more
07-28-2015
07:47 AM
|
1
|
4
|
2782
|
|
POST
|
Amy, A similar issue came-up before - I found an archived topic that suggests it was an IT/Systems issue: Problems Saving/Accessing Data on a virtualized file server
... View more
07-27-2015
11:14 AM
|
0
|
4
|
7470
|
|
POST
|
What version of ArcGIS are you using? Which OS (Windows 7/64-bit?), and how much memory do you have installed?
... View more
07-27-2015
11:08 AM
|
0
|
1
|
1480
|
|
POST
|
Just curious, are you using the following URL to access the service? http://webgis.arpa.piemonte.it/ags101free/rest/services/energia/impianti_biogas/MapServer/kml/mapImage.kmz Updated - I grabbed the wrong link before!
... View more
07-27-2015
07:14 AM
|
1
|
6
|
2782
|
|
POST
|
Anand, Have a look at the following: Manage data store backups—Installation Guides (10.3 and 10.3.1) | ArcGIS for Server Here, you can find information on adjusting retention time, which can reduce disk space utilization: Change how long backup files are retained The backup directory retains backup files for 31 days by default. That means if you keep the default backup frequency (every 7 days) and retention schedules (31 days), the backup directory will contain five full backups and 31 days of incremental backup files. The size of these files depends on the amount and size of your data. The machine that stores your backups must have enough disk space for all these files. If you increase the backup frequency, consider decreasing the retention period for the backup files. In the previous section, the backup frequency was increased to every 14 days. To prevent your backup directory from becoming too large, decrease the backup file retention period. The syntax to run the updatebackupretaindays utility is as follows: updatebackupretaindays <number of days> In the following example, backup file retention time is changed to 27 days: updatebackupretaindays 27 On a side note for PostgreSQL installations, I've heard of some people using PostgreSQL: Documentation: 9.5: pg_archivecleanup for cleanup... I'm not sure if it's compatible with ArcGIS. Here's a discussion on better understanding what the tool will do: postgresql - I need help understanding Postgres's archive cleanup functionality - Database Administrators Stack Exchange
... View more
07-27-2015
06:54 AM
|
0
|
4
|
6097
|
|
POST
|
Yeap - try this sample: ArcGIS API for JavaScript Sandbox Use this code: <!DOCTYPE html>
<html dir="ltr">
<link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title>ArcGIS API for JavaScript | Search widget with multiple sources</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.14/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">
<style>
html,
body,
#map {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
#search {
display: block;
position: absolute;
z-index: 2;
top: 20px;
left: 74px;
}
</style>
</script>
<script src="http://js.arcgis.com/3.14/"></script>
<script>
require([
"esri/map", "esri/dijit/Search", "esri/layers/FeatureLayer", "esri/InfoTemplate", "dojo/domReady!"
], function (Map, Search, FeatureLayer, InfoTemplate) {
var map = new Map("map", {
basemap: "gray",
center: [-97, 38], // lon, lat
zoom: 5
});
var s = new Search({
enableButtonMode: true, //this enables the search widget to display as a single button
enableLabel: false,
enableInfoWindow: true,
showInfoWindowOnSelect: false,
map: map
}, "search");
//var sources = s.get("sources");
var sources = [];
//Push the sources used to search, by default the ArcGIS Online World geocoder is included. In addition there is a feature layer of US congressional districts. The districts search is set up to find the "DISTRICTID". Also, a feature layer of senator information is set up to find based on the senator name.
sources.push({
featureLayer: new FeatureLayer("http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/CongressionalDistricts/FeatureServer/0"),
searchFields: ["DISTRICTID"],
displayField: "DISTRICTID",
exactMatch: false,
outFields: ["DISTRICTID", "NAME", "PARTY"],
name: "Congressional Districts",
placeholder: "3708",
maxResults: 6,
maxSuggestions: 6,
//Create an InfoTemplate and include three fields
infoTemplate: new InfoTemplate("Congressional District", "District ID: ${DISTRICTID}</br>Name: ${NAME}</br>Party Affiliation: ${PARTY}"),
enableSuggestions: true,
minCharacters: 0
});
sources.push({
featureLayer: new FeatureLayer("http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/US_Senators/FeatureServer/0"),
searchFields: ["Name"],
displayField: "Name",
exactMatch: false,
name: "Senator",
outFields: ["*"],
placeholder: "Senator name",
maxResults: 6,
maxSuggestions: 6,
//Create an InfoTemplate
infoTemplate: new InfoTemplate("Senator information", "Name: ${Name}</br>State: ${State}</br>Party Affiliation: ${Party}</br>Phone No: ${Phone_Number}<br><a href=${Web_Page} target=_blank ;'>Website</a>"),
enableSuggestions: true,
minCharacters: 0
});
//Set the sources above to the search widget
s.set("sources", sources);
s.startup();
});
</script>
</head>
<body>
<div id="search"></div>
<div id="map"></div>
</body>
</html> I set the sources var to an empty array and just pushed the ones explicitly added; not the ones inherently available on construction. Alternatively, you can keep the original sample and just set the sources constructor property to an empty array, or to your sources: var s = new Search({
enableButtonMode: true, //this enables the search widget to display as a single button
enableLabel: false,
enableInfoWindow: true,
showInfoWindowOnSelect: false,
map: map,
sources: []
}, "search");
var sources = s.get("sources");
... View more
07-24-2015
12:23 PM
|
4
|
1
|
1787
|
|
POST
|
Ok, so it looks like hide will work, but you can't key off of the KML load event... it must be too early to call the hide method. It works if I use "update-end": kml.on("update-end", function() {
layers = kml.getLayers();
layers[1].hide();
console.log("layer hidden");
}); It doesn't seem to fire this more than twice. Panning and zooming doesn't cause the "update-end" to fire on a KML.
... View more
07-24-2015
12:11 PM
|
0
|
1
|
2042
|
|
POST
|
Charles, hide() does not work as anticipated, for some reason. Maybe it's a bug, maybe I'm not understanding it correctly. Using this sample - ArcGIS API for JavaScript Sandbox - I modified the kml to use the one you posted and here's what I found... var layers;
kml.on("load", function() {
domStyle.set("loading", "display", "none");
layers = kml.getLayers();
dojo.forEach(layers, function(layer){
layer.hide();
console.log(layer.visible);
});
}); In the console, both layers have visible as false, but they still show. As a workaround, try something like this (using opacity): <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title></title>
<link rel="stylesheet" href="http://js.arcgis.com/3.14/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">
<style>
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
#map { height: 100%; margin: 0; padding: 0; }
#meta {
position: absolute;
left: 20px;
bottom: 20px;
width: 300px;
height: 100px;
z-index: 40;
background: #fff;
color: #777;
padding: 5px;
border: 2px solid #666;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
font-family: arial;
font-size: 0.9em;
}
#meta h3 {
color: #666;
font-size: 1.1em;
padding: 0px;
margin: 0px;
display: inline-block;
}
#loading {
float: right;
}
</style>
<script src="http://js.arcgis.com/3.14/"></script>
<script>
var map;
require([
"esri/map", "esri/layers/KMLLayer",
"dojo/parser", "dojo/dom-style",
"dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!"
], function(
Map, KMLLayer,
parser, domStyle
) {
map = new Map("map", {
basemap: "topo",
center: [-108.663, 42.68],
zoom: 6
});
parser.parse();
var kmlUrl = "http://www.wpc.ncep.noaa.gov/kml/qpf/QPF6hr_f00-f06_latest.kml";
var kml = new KMLLayer(kmlUrl);
map.addLayer(kml);
var layers;
kml.on("load", function() {
domStyle.set("loading", "display", "none");
layers = kml.getLayers();
layers[1].opacity = 0.0
});
});
</script>
</head>
<body class="tundra">
<div data-dojo-type="dijit/layout/BorderContainer"
data-dojo-props="design:'headline',gutters:false"
style="width: 100%; height: 100%; margin: 0;">
<div id="map"
data-dojo-type="dijit/layout/ContentPane"
data-dojo-props="region:'center'">
<div id="meta">
<span id="loading"><img src="images/loading_black.gif" /></span>
<h3>Display KML Using a <a href="https://developers.arcgis.com/javascript/jsapi/kmllayer-amd.html">KMLLayer</a></h3>
<br />
The map displays a simple KML file that was created using Google Earth and
is hosted on an Esri server. Symbology and attributes are honored.
<div>
</div>
</div>
</body>
</html>
... View more
07-24-2015
11:54 AM
|
0
|
2
|
2042
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-16-2020 01:25 PM | |
| 1 | 03-20-2019 09:07 AM | |
| 2 | 07-31-2015 07:31 AM | |
| 1 | 09-14-2015 12:14 PM | |
| 1 | 05-12-2015 12:04 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-27-2023
02:30 AM
|