目前接触百度地图API asp.net 应用 找到相关学习资料 很有帮助。效果如下图
百度地图API实例 http://developer.baidu.com/map/jsdemo.htm#a1_1
地图效果展示实例:http://www.hjlib.org/cd/tiles/zoom/index.html
百度地图 点聚合 http://www.cnblogs.com/chenjiahong/p/3917528.html
实现点聚合实例代码
//创建和初始化地图函数: function initMap() { window.map = new BMap.Map("content",{ minZoom: 13,maxZoom:19 });//创建地图对象容器,地图级别最小13,最大14 map.centerAndZoom(new BMap.Point(setCenter1,setCenter2),13);//设置地图中心点和初始缩放级别 //map.centerAndZoom(new BMap.Point(118.789287,32.048784),4); map.setCurrentCity("沈阳"); var stCtrl = new BMap.PanoramaControl(); //构造全景控件 stCtrl.setOffset(new BMap.Size(20,50)); map.addControl(stCtrl); //添加全景控件 //map.addControl(new BMap.ScaleControl()); map.addControl(new BMap.NavigationControl()); //地图平移缩放控件 map.enableScrollWheelZoom(); // 启动鼠标滚轮操作 window.myDis = new BMapLib.DistanceTool(map); //测距 window.searchClass = new SearchClass();//创建对象 searchClass.setData(BASEDATA); //赋值 var dd = searchClass.search({ k: "title",d: "",t: "more",s: "" }); //t:{single|more},s{all|!all} 查询数据(暂无用_2014.07.17) driving = new BMap.DrivingRoute(map,{//创建驾车对象 renderOptions: { map: map,autoViewport: true,panel: "panel2" } }); transit = new BMap.TransitRoute(map,{ //创建公交对象 renderOptions: { map: map,panel: "panel2" } }); local = new BMap.LocalSearch(map,{ onSearchComplete: searchComplete }); //创建查询对象 addmarkers(dd); //向地图添加点聚合标注 }
//创建markers 点聚合 window.addmarkers = function (data) { map.clearOverlays(); var markers = []; for (var i = 0; i < data.length; i++) { var json = data[i]; var p0 = json.point.split("|")[0]; var p1 = json.point.split("|")[1]; var point = new BMap.Point(p0,p1); var iconImg = createIcon(json.icon); var iw = createInfoWindow(i); markers.push(new BMap.Marker(point)); var markerClusterer = new BMapLib.MarkerClusterer(map,{ markers: markers }); } }原文链接:https://www.f2er.com/javaschema/285364.html