-1

I want to check if the marker is in the current view bounds using Here Map and javascript.

I'm looking for something equivalent to map.getBounds().contains(marker.getPosition()) but in Here Maps API

  • Thank you for you help, I want to compare latitude and longitude of the marker with the latitude and longitude of the current view bounds. I used `marker.getGeometry()` and `map.getboundingBox` but it gives me `TypeError: marker.getBoundingBox is not a function` how can I get the corners of the map – Loubna Tani Mar 10 '21 at 19:44

1 Answers1

0

Here maps uses boundingBox Objects to check if elements(or events) are within the box.

What you can do, is give get the boundingBox of the map(at the current zoom level), and then check the 4 corners of the map, again marker position as shown here.

For a more in-depth explanation of boundingBox, look here.

Ayman Jabr
  • 11
  • 3
  • Thank you for you help, I want to compare latitude and longitude of the marker with the latitude and longitude of the current view bounds. I used `marker.getGeometry()` and `map.getboundingBox` but it gives me `TypeError: marker.getBoundingBox is not a function`. How can I get the boundingBox oft the map using `getBoundingBox ()` – Loubna Tani Mar 10 '21 at 20:05