Changeset 7733
- Timestamp:
- Apr 13, 2010, 2:07:42 PM (15 years ago)
- Location:
- trunk/src/map/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/map/inc/markerClusterer.js
r7732 r7733 79 79 var clusters_ = []; 80 80 var map_ = map; 81 var maxZoom_ = null;81 var maxZoom_ = 15; 82 82 var me_ = this; 83 83 var gridSize_ = 60; … … 554 554 } 555 555 if (clusterMarker_ === null) { 556 clusterMarker_ = new ClusterMarker_(center_, this.getTotalMarkers(), markerClusterer_.getStyles_(), markerClusterer_.getGridSize_() );556 clusterMarker_ = new ClusterMarker_(center_, this.getTotalMarkers(), markerClusterer_.getStyles_(), markerClusterer_.getGridSize_(), markers_); 557 557 map_.addOverlay(clusterMarker_); 558 558 } else { … … 605 605 * @param {Number} padding Padding of marker center. 606 606 */ 607 function ClusterMarker_(latlng, count, styles, padding ) {607 function ClusterMarker_(latlng, count, styles, padding, markerArray) { 608 608 var index = 0; 609 this.markerArray = markerArray; 609 610 var dv = count; 610 611 while (dv !== 0) { … … 636 637 ClusterMarker_.prototype.initialize = function (map) { 637 638 this.map_ = map; 639 var markerArray = this.markerArray; 638 640 var div = document.createElement("div"); 639 641 var latlng = this.latlng_; … … 670 672 map.getPane(G_MAP_MAP_PANE).appendChild(div); 671 673 var padding = this.padding_; 672 GEvent.addDomListener(div, " click", function () {674 GEvent.addDomListener(div, "doubleclick", function () { 673 675 var pos = map.fromLatLngToDivPixel(latlng); 674 676 var sw = new GPoint(pos.x - padding, pos.y + padding); … … 679 681 map.setCenter(latlng, zoom); 680 682 }); 683 //Jan: We add our own mouseover listener for the cluster. 684 GEvent.addDomListener(div, "mouseover", function() { 685 mouseOverCluster(markerArray); 686 }); 681 687 this.div_ = div; 682 688 }; -
trunk/src/map/inc/nodemapWL.js
r7732 r7733 33 33 //This function adds a marker with an object from our 'marker'array defined in index.php 34 34 function addMarker(current, i) { 35 var marker = new GMarker(new GLatLng(current.latitude[0], current.longitude[0])); 35 var id = current.id; 36 var marker = new GMarker(new GLatLng(current.latitude[0], current.longitude[0]), {title: id}); 36 37 //Added mouseover listener that calls on our mouseOver function when the mouse moves over a marker on the map 37 38 GEvent.addListener(marker, 'mouseover', function() { … … 42 43 } 43 44 44 //Our mouseover function 45 //Our mouseover function for single nodes. Gives the ID(our own given ID) and the name of the node. 45 46 function mouseOver(id, name) 46 47 { … … 49 50 obj.innerHTML = id+" - "+name; 50 51 //We will replace this function with a httprequest to a php file in the future 52 53 54 /* 55 *Hieronder verdergaan met dekking 56 */ 57 } 58 59 //Our mouseover function for Cluster nodes. 'markers' is an array containing all markers within the cluster 60 function mouseOverCluster(markers) 61 { 62 var markerTitles = new Array; 63 this.obj = document.getElementById("infotop"); 64 for(var i=0; i<markers.length; i++) { 65 markerTitles.push(markers[i].marker.getTitle()+"<br/>"); 66 } 67 obj.innerHTML = markerTitles; 68 69 /* 70 *Hieronder verdergaan met dekking 71 */ 51 72 } 52 73
Note:
See TracChangeset
for help on using the changeset viewer.