Novice Help, I developed the program to place marker on the map, is done by a function:
function Addmarker (getpoint,outcontent,titlecontent) {var opts = { Position:getpoint,//Specifies the location where the text callout is located offset:new bmap.size (10, 0)//Set text offset} var label = new Bmap.label (titlecontent, O pts); Create a text callout object Label.setstyle ({color: "Red", FontSize: "12px", Height: "20px", Lineheight: "20px", fontFamily: "Microsoft Jas Black"}); var marker = new Bmap.marker (getpoint); var Infowindow = new Bmap.infowindow (outcontent,{width:300}); Create Information Window object//var Titlewindow = new Bmap.infowindow (titlecontent, {width:50,height:5}); Map.addoverlay (marker); Marker.addeventlistener ("MouseOver", function () {this.map.addOverlay (label);}); Marker.addeventlistener ("Mouseout", function () {this.map.removeOverlay (label);}); Marker.addeventlistener ("click", Function () {This.openinfowindow (Infowindow); document.getElementById (' Smallpic ') . onload = function () {Infowindow.redraw ();} }); }
Then use the For loop to set the coordinates of each point that has been read, the label to be displayed, the contents of the Infowindow that need the popup, and punctuation on the map:
for (i = 0; i < locations.length; i++) {addMarker(point,readContent,titleContent); }
Now the problem is a lot of points, need to use markerclusterer for point aggregation, but if you follow the example code, build an array to import all the coordinates, the aggregation is successful, but the resulting aggregation point is no label and Infowindow, It feels like the aggregation point is directly generating a batch of new marker caps on top. How can I write to solve this problem? Thank you!