百度地图api怎么在百度地图 添加多个标注点 放到自己想要的位置上 还有就是每个标注点怎么才显示不同的复杂内容 求懂百度地图api 大虾解决啊!!!!!!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 var map = new BMap.Map("container"); var opts = { type: BMAP_NAVIGATION_CONTROL_LARGE } map.addControl(new BMap.NavigationControl(opts)); map.addControl(new BMap.ScaleControl()); map.addControl(new BMap.OverviewMapControl()); map.addControl(new BMap.MapTypeControl()); var GetAllLongitude = new Array(); var GetaLat = new Array(); var GetLongitudeOne = 1.1; var GetZeroLatitude = 1.1; $.ajax({ async: false, type: "POST", contentType: "application/json", url: "LocusQueries.aspx/GetAllLng", dataType: 'json', success: function GetAllLng1(result) { GetAllLongitude = result.d; } }); $.ajax({ async: false, type: "POST", contentType: "application/json", url: "LocusQueries.aspx/GetAllLat", dataType: 'json', success: function GetAllLat1(result) { GetaLat = result.d; } }); $.ajax({ async: false, type: "POST", contentType: "application/json", url: "LocusQueries.aspx/lastlng", dataType: 'json', success: function lastlng1(result) { GetLongitudeOne = result.d; } }); $.ajax({ async: false, type: "POST", contentType: "application/json", url: "LocusQueries.aspx/lastlat", dataType: 'json', success: function lastlat1(result) { GetZeroLatitude = result.d; } }); // 初始化百度地图中心,并添加常用控件 map.centerAndZoom(new BMap.Point(GetLongitudeOne,GetZeroLatitude),15); // 画出折线即轨迹 var point = []; var er = []; var r = GetAllLongitude.length; for (var i = 0; i < r; i++) { point[i] = new BMap.Point(GetAllLongitude[i], GetaLat[i]); er[i] = new BMap.Marker(point[i]); map.addOverlay(er[i]); // 将标注添加到地图中 } var polyline = new BMap.Polyline(); polyline.setPath(point); polyline.setStrokeColor("blue"); polyline.getStrokeWeight(6); polyline.setStrokeOpacity(0.5); map.addOverlay(polyline); map.enableKeyboard(); //启用键盘,默认关闭 var GetAllLongitude = new Array(); var GetaLat = new Array(); var GetLongitudeOne = 1.1; var GetZeroLatitude = 1.1; / /用来接收数据库返回的类型 $.ajax({ //利用ajax 从后台输出数据到javascript async: false, type: "POST", contentType: "application/json", url: "LocusQueries.aspx/lastlat", dataType: 'json', success: function lastlat1(result) { GetZeroLatitude = result.d; } }); }//后台我用的webService. 前台javascript .后台用的C# [WebMethod(Description = "获取签最后签到日的经度")] public static string lastlng() { Page page = new Page(); JsonObject json = new JsonObject(); SignInManage sig = new SignInManage(); return sig.GetZeroLongitudeManage(page.Session["userName"].ToString()); } [WebMethod(Description = "获取签最后签到日的纬度")] public static string lastlat() { Page page = new Page(); JsonObject json = new JsonObject(); SignInManage sig = new SignInManage(); return sig.GetZeroLatitudeManage(page.Session["userName"].ToString()); } [WebMethod(Description = "获取用户签到日所有的纬度")] public static List<string> GetAllLng() { Page page = new Page(); JsonObject json = new JsonObject(); SignInManage sig = new SignInManage(); return sig.GetAllLongitudeManage(page.Session["SearDate"].ToString(), page.Session["userName"].ToString()); } [WebMethod(Description = "获取签最后签到日的所有经度")] public static List<string> GetAllLat() { Page page = new Page(); JsonObject json = new JsonObject(); SignInManage sig = new SignInManage(); return sig.GetAllLatitudeManage(page.Session["SearDate"].ToString(), page.Session["userName"].ToString()); } 我的Jsp数据库连接 html文档(包含js代码)的解析和运行有什么区别? parseInt(yourvar,10) 里面有两个参数后面的10是干嘛的呢? JavaScript获取连接<a ID=???></a> 标签ID的值 动态添加的一行表格 怎么把他取消掉? 相同Width的Text和Select控件,在画面上显示的不一样宽,高手指教 为什么有时候js要放在head里面 我放在最下面 不行么?哪种更标准? 救救我吧,等着要货呢,进来看看吧。 日期跳转 函数封装 小例子 拆分数组,第五天,弄不出来.再次发贴,请教老师 一个jquery跟自己写的JS的冲突
var opts = { type: BMAP_NAVIGATION_CONTROL_LARGE }
map.addControl(new BMap.NavigationControl(opts));
map.addControl(new BMap.ScaleControl());
map.addControl(new BMap.OverviewMapControl());
map.addControl(new BMap.MapTypeControl()); var GetAllLongitude = new Array();
var GetaLat = new Array();
var GetLongitudeOne = 1.1;
var GetZeroLatitude = 1.1; $.ajax({
async: false,
type: "POST",
contentType: "application/json",
url: "LocusQueries.aspx/GetAllLng",
dataType: 'json',
success: function GetAllLng1(result) {
GetAllLongitude = result.d;
}
}); $.ajax({
async: false,
type: "POST",
contentType: "application/json",
url: "LocusQueries.aspx/GetAllLat",
dataType: 'json',
success: function GetAllLat1(result) {
GetaLat = result.d;
}
});
$.ajax({
async: false,
type: "POST",
contentType: "application/json",
url: "LocusQueries.aspx/lastlng",
dataType: 'json',
success: function lastlng1(result) {
GetLongitudeOne = result.d;
} });
$.ajax({
async: false,
type: "POST",
contentType: "application/json",
url: "LocusQueries.aspx/lastlat",
dataType: 'json',
success: function lastlat1(result) {
GetZeroLatitude = result.d;
}
});
// 初始化百度地图中心,并添加常用控件 map.centerAndZoom(new BMap.Point(GetLongitudeOne,GetZeroLatitude),15);
// 画出折线即轨迹
var point = [];
var er = [];
var r = GetAllLongitude.length; for (var i = 0; i < r; i++) {
point[i] = new BMap.Point(GetAllLongitude[i], GetaLat[i]);
er[i] = new BMap.Marker(point[i]);
map.addOverlay(er[i]); // 将标注添加到地图中
} var polyline = new BMap.Polyline();
polyline.setPath(point);
polyline.setStrokeColor("blue");
polyline.getStrokeWeight(6);
polyline.setStrokeOpacity(0.5);
map.addOverlay(polyline);
map.enableKeyboard(); //启用键盘,默认关闭
var GetaLat = new Array();
var GetLongitudeOne = 1.1;
var GetZeroLatitude = 1.1; / /用来接收数据库返回的类型 $.ajax({ //利用ajax 从后台输出数据到javascript
async: false,
type: "POST",
contentType: "application/json",
url: "LocusQueries.aspx/lastlat",
dataType: 'json',
success: function lastlat1(result) {
GetZeroLatitude = result.d;
}
});
}
//后台我用的webService. 前台javascript .后台用的C#
[WebMethod(Description = "获取签最后签到日的经度")]
public static string lastlng()
{
Page page = new Page();
JsonObject json = new JsonObject();
SignInManage sig = new SignInManage();
return sig.GetZeroLongitudeManage(page.Session["userName"].ToString()); }
[WebMethod(Description = "获取签最后签到日的纬度")]
public static string lastlat()
{
Page page = new Page();
JsonObject json = new JsonObject();
SignInManage sig = new SignInManage();
return sig.GetZeroLatitudeManage(page.Session["userName"].ToString()); }
[WebMethod(Description = "获取用户签到日所有的纬度")]
public static List<string> GetAllLng()
{
Page page = new Page();
JsonObject json = new JsonObject();
SignInManage sig = new SignInManage();
return sig.GetAllLongitudeManage(page.Session["SearDate"].ToString(), page.Session["userName"].ToString()); }
[WebMethod(Description = "获取签最后签到日的所有经度")]
public static List<string> GetAllLat()
{
Page page = new Page();
JsonObject json = new JsonObject();
SignInManage sig = new SignInManage();
return sig.GetAllLatitudeManage(page.Session["SearDate"].ToString(), page.Session["userName"].ToString()); }