I am using the coordinateConversion widget and I need to give it a location manually. I have a button that does an external conversion to the widget and that conversion returns longitude and latitude. I need to send those coordinates to the widget to be able to visualize them but I have not been able to do it, what can I do in this case, is there any way to pass that position to the widget?
Thanks in advance
Solved! Go to Solution.
This is done by setting the currentLocation property. The documentation says that property is read-only, but that's incorrect.
function visualize(latitude, longitude, ccWidget) {
ccWidget.currentLocation = Point.fromJSON({x:longitude,y:latitude,spatialReference:{wkid:4326}});
}
Lo he conseguido tal cual instanciando un nuevo punto y asignandoselo a la propiedad de currentLocation
const point = new Point({
latitude: decimalLatitude,
longitude: -decimalLongitude
});
coordinate_convers.currentLocation = point
This is done by setting the currentLocation property. The documentation says that property is read-only, but that's incorrect.
function visualize(latitude, longitude, ccWidget) {
ccWidget.currentLocation = Point.fromJSON({x:longitude,y:latitude,spatialReference:{wkid:4326}});
}
Lo he conseguido tal cual instanciando un nuevo punto y asignandoselo a la propiedad de currentLocation
const point = new Point({
latitude: decimalLatitude,
longitude: -decimalLongitude
});
coordinate_convers.currentLocation = point