Hi
View.goTo is not working any suggestion..?
let point = {
type: "point",
x: i.geometry.x,
y: i.geometry.y,
spatialReference: { wkid: 32642}
}
let g = new Graphic({
geometry: point,
symbol: {
type: "simple-marker",
size: 7,
color: [227, 241, 18],
outline: null
}
})
view.goTo({
target: point,
zoom: 12
});
view.graphics.add(g)
Output of point object is....
Solved! Go to Solution.
Kawish,
You have to project the geometry to the same spatial reference as the map.
Kawish,
Though a Graphic can autocast the geometry object you are feeding it. The GoTo is expecting an actual Geometry class and not a Object class.
So you can change to:
view.goTo({
target: g,
zoom: 12
});
since the goTo function can take a graphic, geometry, etc
Robert
Its not working properly and map goes to wrong position while graphic update/add on exact location
Kawish,
You have to project the geometry to the same spatial reference as the map.
Thank You Robert