来自Google Map api中Fusion Table的Marker Clusters

时间:2015-02-06 00:46:47

标签: javascript google-maps

我正在使用标准圈子从Google Fusion桌面映射20k记录。我想用MarkerClusters对它们进行分组。因为有过滤和搜索发生,我不知道在哪里放置var markerCluster = new MarkerClusterer(map,markers);代码。

Here is the map.

创建标记的代码段:

//*New Fusion Tables Requirement* API key. found at https://code.google.com/apis/console/
  //*Important* this key is for demonstration purposes. please register your own.
  googleApiKey:       "AIzaSyDj8qostHt2L3aetpO_LuipyS6YvfeZOFA",

  //name of the location column in your Fusion Table.
  //NOTE: if your location column name has spaces in it, surround it with single quotes
  //example: locationColumn:     "'my location'",
  locationColumn:     "geo_coordinates",

  map_centroid:       new google.maps.LatLng(40.7127,-74.0059), //center that your map defaults to
  locationScope:      "new york city",      //geographical area appended to all address searches
  recordName:         "result",       //for showing number of results
  recordNamePlural:   "results",

  searchRadius:       805,            //in meters ~ 1/2 mile
  defaultZoom:        13,             //zoom level when map is loaded (bigger is more zoomed in)
  addrMarkerImage:    'images/blue_pin.png',
  currentPinpoint:    null,


  initialize: function() {
    $( "#result_count" ).html("");

    geocoder = new google.maps.Geocoder();
    var myOptions = {
      zoom: MapsLib.defaultZoom,
      center: MapsLib.map_centroid,
      mapTypeId: google.maps.MapTypeId.TERRAIN,


            };  
    map = new google.maps.Map($("#map_canvas")[0],myOptions);
    map.setTilt(45);
    map.setOptions({ styles : styles });

    // maintains map centerpoint for responsive design
    google.maps.event.addDomListener(map, 'idle', function() {
        MapsLib.calculateCenter();
    });

    google.maps.event.addDomListener(window, 'resize', function() {
        map.setCenter(MapsLib.map_centroid);
    });

    MapsLib.searchrecords = null;

0 个答案:

没有答案