I'm new with HERE API (still testing it) I have 2 questions:
I have number of pins on the map. Can you script find automatically the center of the pins locations
For each pin I have div box with info (each div have unique ID). can I click on the pin and the page will scroll to the right div/position? see example here with google map: http://www.followmyroutes.com/index.php?page=itinPage&itinID=16
Regards,
Roi
Zooming to a set of markers is easy. The idea is to use the method setViewBounds on the map instance.
// some examples marker
var toronto = new H.map.Marker({lat:43.7, lng: -79.4});
var boston = new H.map.Marker({lat:42.35805, lng: -71.0636}),
var washington = new H.map.Marker({lat:38.8951, lng: -77.0366}),
// a group object to contain the markers
var group = new H.map.Group();
// add markers to the group
group.addObjects([toronto, boston, washington]);
// add the group to the map instance
map.addObject(group);
// get geo bounding box for the group and zoom into it
map.setViewBounds(group.getBounds());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With