Changeset 7732 for trunk/src/map


Ignore:
Timestamp:
Apr 13, 2010, 12:16:45 PM (15 years ago)
Author:
janveeden
Message:

Clustering markers now works. Still has to be tweaked a bit +have to add/edit some more event listeners to the clusters.

Location:
trunk/src/map/inc
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/map/inc/nodemapWL.js

    r7722 r7732  
    33var toggleState = 1;
    44var marker_hash = {};
     5var markerArray = new Array();
    56
    67        //This function is called from index.php
     
    1718                for (var i=0; i<markers.length; i++) {
    1819            var current = markers[i];
    19             var marker  = addMarker(current);
     20            var marker  = addMarker(current, i);
    2021            marker_hash[current.id] = {marker : marker};
    2122        }
     23               
     24                var markerClusterer = new MarkerClusterer(map, markerArray);
    2225          }
    2326        }
    2427       
    2528        //This function will contain the displaying and not displaying of nodes on the map
    26         function toggleNodes() {
    27           if (toggleState == 1) {
    28         map.removeOverlay(geoXml);
    29         toggleState = 0;
    30           } else {
    31                 map.addOverlay(geoXml);
    32         toggleState = 1;
    33           }
     29        function toggleMyKml() {
     30       
    3431        }
    3532       
    3633        //This function adds a marker with an object from our 'marker'array defined in index.php
    37         function addMarker(current) {
     34        function addMarker(current, i) {
    3835      var marker  = new GMarker(new GLatLng(current.latitude[0], current.longitude[0]));
    39       map.addOverlay(marker);
    4036          //Added mouseover listener that calls on our mouseOver function when the mouse moves over a marker on the map
    4137      GEvent.addListener(marker, 'mouseover', function() {
    4238          mouseOver(current.id, current.name[0]);
    4339      });
     40          markerArray[i] = marker;
    4441      return marker;
    4542    }
Note: See TracChangeset for help on using the changeset viewer.