AnsweredAssumed Answered

View goTo() with Point

Question asked by opli on Mar 6, 2019

Hi,

 

Noticed that zooming with single Point with .goTo({ target: geometries }) does not work. If I have 2 Points in array of 'geometries' then zooming to target is working.

 

What I'm missing? a single Point does not have extent, is that the reason why zooming does not work?

I'm using same view.toGo() to Point, Polygon, Polyline -geometries and it is working fine but single Point does not zoom to the target.

 

I have attached demo of the problem. Press "Bounce to Berlin" -button to notice that zooming to target is not working. 

Using JS API 4.10.

 

UPDATE: Solved problem with check

if (geometries && geometries.length === 1 && geometries[0].type === 'point') {
view.goTo({
target: geometries,
scale: view.maxScale,
});

}

 

Br,

Markus

Attachments

Outcomes