As a beginner, but also self-study, a simple problem for others, for themselves is like an insurmountable mountain
But when the problem is solved by itself, the joy is unspeakable.
Recently in a multi-point location display, before doing a single-point positioning display of small cases, I would like to apply that, but did a lot of trying to find that no
Later consulted a lot of information, but also combined with Baidu map demo, finally in accordance with their own understanding out, here and everyone to share, master do not laugh
<script type= "Text/javascript" > //Baidu Map API function var map = new Bmap.map ("Allmap"); var point = new Bmap.point (116.404, 39.915); Map.centerandzoom (point, N); Enable wheel zoom to zoom out map.enablescrollwheelzoom (true); Write a custom function to create a callout function Addmarker (point) { var marker = new Bmap.marker (point); Map.addoverlay (marker); } var lon = "<%=session[" longitude "]%>";//previous page read out from the database longitude information, stored to the string var lat = "<%=session[" Latitude "]% > ";//The Latitude information that was read out from the database in the previous page, stored to the string var Lonarr = new Array (); Lonarr = Lon.split (",");//store to array var Latarr = new Array (); Latarr = Lat.split (","); Stores the corresponding latitude and longitude information for the array//loop (var i = 0; i < lonarr.length; i++) { var point = new Bmap.point (Lonarr[i], l Atarr[i]); Addmarker (point); } </script>
Dynamic add multipoint location display based on Baidu API