POST
|
Hi everybody, I´m developing an app. I draw a line in a map and I have an array with distances in meters. I need transform these distances into the polyline in points, and I don´t know do it. I prepared next two functions. I use line and position as parameters in LRSLocatePoint. Line is my poliline and position is the distance value, but is not working. function LRSLocatePoint(line, position) {
require([
"esri/geometry/Point"
],
function (Point) {
var curPos = 0;
var point = false;
var myspatialReference = line.spatialReference;
var arraylinepaths = line.paths[0];
for (var i = 0; i < arraylinepaths.length; i++) {
lastPos = curPos;
var position1 = new Point(arraylinepaths, myspatialReference);
var position2 = new Point(arraylinepaths[i + 1], myspatialReference);
curPos = curPos + esri.geometry.getLength(position1, position2);
if (curPos > position) {
var posicionRelativa = (position - lastPos) / (curPos - lastPos);
point = LRSLocatePointOnSegment(
arraylinepaths,
arraylinepaths[i + 1],
posicionRelativa
);
break;
}
}
return point;
});
}
function LRSLocatePointOnSegment(point1, point2, position) {
var point = false;
if (position >= 0 && position <= 1) {
x1 = point1.x;
y1 = point1.y;
x2 = point2.x;
y2 = point2.y;
x = x1 + (x2 - x1) * position;
y = y1 + (y2 - y1) * position;
var spatialReference = map.spatialReference;
point = new esri.geometry.Point(x, y, spatialReference);
console.log(point);
}
return point;
} Help!!!!:confused: , thank you:D
... View more
06-17-2014
02:13 PM
|
0
|
0
|
345
|
POST
|
I´m creating a sea surface temperature data service in order to do temperature profiles. When I run stack profile tool (with a polyline and a temperature raster as parameters) I get like result a table with diferents distances in the polyline and its z-value. I need transform this distances in their corresponding XY coordinates (I need to show this information in a popup). How can I transform these distances in xy coordinates? Thank you!!!
... View more
06-02-2014
01:50 AM
|
0
|
0
|
460
|
POST
|
Hi everybody, I´m trying to add diferents layers to my app from this link: http://gmis.jrc.ec.europa.eu/webservices/4km/wms/pathfinder? And I check the capabilities here: http://gmis.jrc.ec.europa.eu/webservices/4km/wms/pathfinder/?request=getcapabilities&service=wms In ArcMap I use this conecction and I don´t have any problem. In my app I use the next code: //#region wmsLayers
declare("my.nexradWMSLayer", DynamicMapServiceLayer, {
constructor: function () {
this.initialExtent = this.fullExtent = new Extent({
xmin: -180,
ymin: -90,
xmax: 180,
ymax: 90,
spatialReference: {
wkid: 4326
}
});
this.spatialReference = new esri.SpatialReference({
wkid: 4326
});
this.loaded = true;
this.onLoad(this);
console.log(this);
},
getImageUrl: function (extent, width, height, callback) {
var params = {
request: "GetMap",
transparent: true,
format: "image/png",
transparent: "true",
bgcolor: "ffffff",
version: "1.3.0",
layers: "GMIS_P_ANO_SST_09_1981, GMIS_P_ANO_SST_10_1981",
styles: "default,default",
exceptions: "application/vnd.ogc.se_xml",
//changing values
bbox: extent.xmin + "," + extent.ymin + "," + extent.xmax + "," + extent.ymax,
srs: "EPSG:" + extent.spatialReference.wkid,
width: width,
height: height
};
callback("http://gmis.jrc.ec.europa.eu/webservices/4km/wms/pathfinder?" + ioquery.objectToQuery(params));
}
})
wmsLayer = new my.nexradWMSLayer();
map.addLayer(wmsLayer, 0);
When run this code, my map is empty and I don´t have errors. I don´t know where is the problem :confused:. Thank you, Luis Miguel
... View more
04-30-2014
02:53 AM
|
0
|
0
|
592
|
POST
|
Hi everybody, I´m trying to use checkbox in order to add or remove my layers on the map. I´m using dojo.on, when change my checkbox I use updateLayerVisibility function: map.addLayers([mangroves, coldcoral, marineEcoregions, pelagicProvinces, wmsLayer]); on(dom.byId("mangroves"), "change", updateLayerVisibility); on(dom.byId("coldcoral"), "change", updateLayerVisibility); on(dom.byId("marineEcoregions"), "change", updateLayerVisibility); on(dom.byId("pelagicProvinces"), "change", updateLayerVisibility); function updateLayerVisibility() { //var visibleLayerIds = [] var inputs = query(".list_item"); var inputCount = inputs.length; map.removeAllLayers(); map.setBasemap("oceans"); for (var i = 0; i < inputCount; i++) { if (inputs.checked) { //visibleLayerIds.push(inputs.value); map.addLayer(inputs.value); } if (inputs.checked == false) { map.removeLayer(inputs.value) } } } But I have a problem with the map.addLayer() sentence. When I checked/unchecked in this sentence I have a exception: "uncaught exception: lang.hitch: scope["onLoad"] is null (scope="[object Window]")". I can´t understand where is the error...:confused: thank you..
... View more
04-21-2014
02:06 PM
|
0
|
1
|
2390
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|