提交 2e3486cc authored 作者: chengye's avatar chengye

测试地图图标

上级 731a9a9a
...@@ -59,9 +59,9 @@ ...@@ -59,9 +59,9 @@
var map = new BMap.Map("allmap", {enableMapClick: false,minZoom:11,maxZoom:14}); var map = new BMap.Map("allmap", {enableMapClick: false,minZoom:11,maxZoom:14});
var point = new BMap.Point(116.40387397,39.91488908); var point = new BMap.Point(116.40387397,39.91488908);
// var iconR = new BMap.Icon("__STATIC__/admin/image/1.png", new BMap.Size(20,20)); var iconR = new BMap.Icon("__STATIC__/admin/image/1.png", new BMap.Size(20,20));
// var iconY = new BMap.Icon("__STATIC__/admin/image/2.png", new BMap.Size(20,20)); var iconY = new BMap.Icon("__STATIC__/admin/image/2.png", new BMap.Size(20,20));
// var iconB = new BMap.Icon("__STATIC__/admin/image/3.png", new BMap.Size(20,20)); var iconB = new BMap.Icon("__STATIC__/admin/image/3.png", new BMap.Size(20,20));
//初始化地图配置 //初始化地图配置
function initMapConf(points = ''){ function initMapConf(points = ''){
...@@ -129,9 +129,7 @@ ...@@ -129,9 +129,7 @@
dataType: "json", dataType: "json",
success: function (res) { success: function (res) {
if (res == 0) { if (res == 0) {
var iconR = new BMap.Icon("__STATIC__/admin/image/1.png", new BMap.Size(20,20));
var iconY = new BMap.Icon("__STATIC__/admin/image/2.png", new BMap.Size(20,20));
var iconB = new BMap.Icon("__STATIC__/admin/image/3.png", new BMap.Size(20,20));
layer.open({ layer.open({
content: "没有查询到匹配数据", content: "没有查询到匹配数据",
btn: ['确定'], btn: ['确定'],
...@@ -198,7 +196,7 @@ ...@@ -198,7 +196,7 @@
function addMarker(point, content) { function addMarker(point, content) {
translateCallback = function (data) { translateCallback = function (data) {
if (data.status === 0) { if (data.status === 0) {
var marker = new BMap.Marker(data.points[0],{icon:iconR}); var marker = new BMap.Marker(data.points[0],{icon:iconB});
map.addOverlay(marker); //把标注添加到地图上 map.addOverlay(marker); //把标注添加到地图上
addClickHandler(content, marker); addClickHandler(content, marker);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论