POST
|
We have recently upgraded our system from ArcGIS 10.0 to ArcGIS 10.4 and Oracle 12. One problem we have been struggling with is that we publish our Map Service Definition file and all the Layers will be working. After a while perishable data (weather data) will be purged out and if the Map Server is restarted the Layers associated will be broken even if new data is added later. It appears that the only way to fix this problem is to restart the Map Server again with data in the database table. Is there a way to prevent this behavior?
... View more
07-12-2017
07:29 AM
|
0
|
0
|
493
|
POST
|
Thanks for the reply! I've made some progress trying to follow your advice and use the geometry server. The points display now! Thank you very much for this. The problem now, though, is that on initial load as well as every time I zoom in or out, I get two errors: Error: <circle> attribute cx: Expected length, "NaN". Error: <circle> attribute cy: Expected length, "NaN". I'm not sure what the cause of this is, since I am only drawing Points on the map and not Circles. Here's the updated method: map.on("load",function(){
console.log(map.extent);
xhr("<rest_url>", {
method: "GET",
handleAs: "json"
}).then(function(jsonData){
Array.forEach(jsonData, function(entry,i){
console.log(entry.platformId + "," + entry.latitude + "," + entry.longitude + " at index " + i );
var pt = new Point(entry.longitude, entry.latitude, new SpatialReference(4326));
gsvc.project([pt], new SpatialReference(102021), function(projectedPoints){
map.graphics.add(new Graphic(projectedPoints[0], symbol));
});
});
});
}); Thanks again for the help!
... View more
02-07-2017
11:47 AM
|
0
|
1
|
223
|
POST
|
I appreciate the time you're taking to help. However, when I do this, canProject returns false and I get no points.
... View more
02-07-2017
10:03 AM
|
0
|
1
|
982
|
POST
|
I've updated the load function to look like this (rest of the code is the same): map.on("load",function(){
console.log(map.extent);
xhr("<rest_url>", {
method: "GET",
handleAs: "json"
}).then(function(jsonData){
Array.forEach(jsonData, function(entry,i){
console.log(entry.platformId + "," + entry.latitude + "," + entry.longitude + " at index " + i );
var pt = new Point(webMercUtils.lngLatToXY(entry.longitude, entry.latitude));
if (webMercUtils.canProject(pt, map))
{
webMercUtils.project(pt, map);
}
}
});
});
}); canProject evaluates to true, but then an error is thrown on the project method. "TypeError: d.equals is not a function" at Object.project (init.js:860). If I change the call to webMercUtils.project(new Graphic(pt, new SimpleMarkerSymbol()), map); then there are no errors, but no points display at all.
... View more
02-07-2017
09:05 AM
|
0
|
3
|
982
|
POST
|
I'm not sure what you mean by "output coordinates for various workflows", but an input point would look like this if the value weren't a variable: new Point(172.5322, -43.4892, new SpatialReference(102021));
... View more
02-07-2017
08:10 AM
|
0
|
3
|
223
|
POST
|
NZCH,-43.4892,172.5322 at index 0 NZAA,-37.0081,174.7917 at index 1 NZIR,-77.8539,166.4686 at index 2
... View more
02-07-2017
07:29 AM
|
0
|
5
|
982
|
POST
|
I'm actually not specifying a basemap. The layer is being added to an empty map. Is a basemap necessary, or is one provided by default (with a potentially incorrect wkid) if I don't specify one? Also, I can't seem to find an esri basemap with wkid 102021. Everything I've found is either 4326 or 3857.
... View more
02-07-2017
07:15 AM
|
0
|
0
|
982
|
POST
|
I'm trying to do something very simple and can not seem to figure out what the problem is. I have a REST service that retrieves locations with decimal lat/long's. I want to add a point to a map for each of these locations. As long as the spatial reference is 4326, everything is fine. If I try to add points in any other spatial reference, they are added incorrectly. Specifically, I am trying to add points to a 102021 projection (Antarctica). Even when I set the map's spatial reference to 102021 and use a layer whose projection is defined as 102021, and specify 102021 as the spatial reference in my Point constructor, the points are not added to the correct locations. Through various attempts, I have been able to get the correct projection with the wrong points, the correct points on the wrong projection, and the wrong projection with the wrong points. All other resources have shown this to be a fairly easy task, but I am at a loss as to why this isn't working, and any help would be greatly appreciated. Code snippet below. var map;
require([
"esri/geometry/Point",
"esri/geometry/Extent",
"esri/tasks/GeometryService",
"esri/tasks/ProjectParameters",
"esri/SpatialReference",
"esri/symbols/SimpleMarkerSymbol",
"esri/graphic",
"esri/Color",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/layers/ArcGISTiledMapServiceLayer",
"esri/map",
"dojo/parser",
"dojo/request/xhr",
"dojo/_base/array",
"esri/geometry/webMercatorUtils",
"dojo/domReady!",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane"],
function(Point, Extent, GeometryService, ProjectParameters, SpatialReference, SimpleMarkerSymbol, Graphic, Color, ArcGISDynamicMapServiceLayer,
ArcGISTiledMapServiceLayer, Map, parser, xhr, Array, webMercUtils)
{
gsvc = new GeometryService("https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
params = new ProjectParameters();
// a map layer defined as 102021
var antarcLayer = new ArcGISDynamicMapServiceLayer("https://gis.icao.int/ArcGIS/rest/services/ANTARCTIC/MapServer");
var symbol = new SimpleMarkerSymbol();
symbol.setColor(new Color("#00FFFF"));
parser.parse();
// coords are passed in
map = new Map("mapDiv", {
extent: new Extent({
xmin: <%=minX%>,
ymin: <%=minY%>,
xmax: <%=maxX%>,
ymax: <%=maxY%>,
spatialReference:{wkid: 102021}
})
});
map.addLayer(antarcLayer);
// I have tried webMercatorUtils to convert from geometry to mercator and back and lat/long to xy and back, and these do not work either
// I have also tried using Geometry Service "project"
map.on("load",function(){
xhr("<rest_url>", {
method: "GET",
handleAs: "json"
}).then(function(jsonData){
Array.forEach(jsonData, function(entry,i){
console.log(entry.platformId + "," + entry.latitude + "," + entry.longitude + " at index " + i );
var pt = new Point(entry.longitude, entry.latitude, new SpatialReference(102021));
map.graphics.add(new Graphic(pt, symbol));
});
});
});
});
</script>
<body class="claro">
<div id="mapDiv"></div>
</body>
... View more
02-03-2017
11:15 AM
|
0
|
14
|
2080
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|