Monday, June 5, 2017

MarkerClusterer at the Google Maps API

This explains it some. In the initMap() function you will have something like, per their (see the link) example...

var markerCluster = new MarkerClusterer(map, markers,
   {imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/
      markerclusterer/m'});
}

 
 

map and markers being the map itself and an array of markers sitting on this map. What this does is it keeps a bunch of markers sitting on top of each other from having unreadable names (due to the jumble) by replacing the markers with a placeholder for the number of markers there. As you drill into the map enough you eventually see markers again when it's not too noisy. You add the likes of https://developers.google
.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js to make this happen. Today I tried a bit to get MarkerClusterer to work with SebmGoogleMapMarker of Angular 2 per this and this but I only got as far as this:

import {SebmGoogleMap, SebmGoogleMapMarker} from 'angular2-google-maps/core';

No comments:

Post a Comment