//Request user Weibo information functionRequest (user_id) {createxmlhttprequest (); Xmlhttp.onreadystatechange=Back ; varstr =GetUrl (); varurl = str + "/points_handle.php?uid=" +user_id; Xmlhttp.open ("GET", URL,true); Xmlhttp.send (NULL); } //Get micro-blog Information functionBack () {if(Xmlhttp.readystate = = 4){ if(Xmlhttp.status = = 200) {//when status is normal varResponse =Xmlhttp.responsetext; varobj = eval (' (' +response+ ') ');//convert JSON data to object form //alert (response); if(Obj.data! =NULL ){ for(vari = 0; i < obj.data.length; i++) { (function(x) {//alert (obj.data[i].point[1]); varPT =NewBmap.point (obj.data[i].point[1],obj.data[i].point[0]); varMarker =NewBmap.marker (PT); varText =Obj.data[i].text; varLength =text.length; //alert (text.length); varopt ={width:300, Height:length+ 50, Title:' <span style= ' font-size:15px;color:red ' > ' + obj.uid + ' </span> '} map.addoverlay (marker); Marker.setanimation (bmap_animation_bounce); Marker.addeventlistener ("Click",function() {openinfo (text,marker,opt); }); }) (i); } //Map.addcontrol (New Bmap.navigationcontrol ());}Else{alert ("The ID is not in the database"); } } } } functionOpenInfo (text,marker,opt) {varp =marker.getposition (); varPoint =NewBmap.point (P.lng,p.lat); varInfowindow =NewBmap.infowindow (text,opt); Map.openinfowindow (Infowindow,point); }
Add a callout point to the map and add a separate information window for each point