fix(地图插件): 调整样式
parent
5c7d421225
commit
2ae0776281
|
@ -21,7 +21,7 @@
|
|||
|
||||
.ew-map-select-poi {
|
||||
height: 505px;
|
||||
width: 250px;
|
||||
width: 240px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
float: left;
|
||||
|
|
|
@ -179,10 +179,12 @@ layui.define(['layer', 'locationX'], function (exports) {
|
|||
|
||||
// 搜索附近方法
|
||||
var searchNearBy = function (lng, lat){
|
||||
console.log('ssss')
|
||||
var point = new BMap.Point(lng, lat);
|
||||
var localSearch = new BMap.LocalSearch(point, {
|
||||
pageCapacity: 10,
|
||||
onSearchComplete: function (result){
|
||||
console.log(result,'rrrrsss')
|
||||
var htmlList = '';
|
||||
$.each(result,function (i,val){
|
||||
$.each(val.Hr,function (i,ad){
|
||||
|
@ -251,7 +253,8 @@ layui.define(['layer', 'locationX'], function (exports) {
|
|||
}
|
||||
var htmlList = '';
|
||||
// $.each(result.Ir,function (i,ad){
|
||||
$.each(result.Kr,function (i,ad){
|
||||
// $.each(result.Kr,function (i,ad){
|
||||
$.each(result.Yr,function (i,ad){
|
||||
htmlList += '<div data-lng="' + ad.point.lng + '" data-lat="' + ad.point.lat + '" data-title="'+ ad.title +'" data-address="'+ ad.address +'" class="ew-map-select-search-list-item">';
|
||||
htmlList += ' <div class="ew-map-select-search-list-item-icon-search"><i class="layui-icon layui-icon-search"></i></div>';
|
||||
htmlList += ' <div class="ew-map-select-search-list-item-title">' + ad.title + '</div>';
|
||||
|
@ -259,7 +262,7 @@ layui.define(['layer', 'locationX'], function (exports) {
|
|||
htmlList += '</div>';
|
||||
});
|
||||
$selectTips.html(htmlList);
|
||||
if (result.Kr.length === 0) $('#ew-map-select-tips').addClass('layui-hide');
|
||||
if (result.Yr.length === 0) $('#ew-map-select-tips').addClass('layui-hide');
|
||||
else $('#ew-map-select-tips').removeClass('layui-hide');
|
||||
}
|
||||
});
|
||||
|
@ -372,6 +375,7 @@ layui.define(['layer', 'locationX'], function (exports) {
|
|||
var localSearch = new T.LocalSearch(map, {
|
||||
pageCapacity: 10,
|
||||
onSearchComplete: function (result){
|
||||
console.log(result,'tiandi search')
|
||||
var htmlList = '';
|
||||
$.each(result.getPois(),function (i,ad){
|
||||
var lnglat = ad.lonlat.split(" ");
|
||||
|
@ -546,6 +550,8 @@ layui.define(['layer', 'locationX'], function (exports) {
|
|||
});
|
||||
var cpoint = [lng, lat];
|
||||
placeSearch.searchNearBy('', cpoint, 1000, function (status, result) {
|
||||
console.log(result, 'gaode 搜索')
|
||||
console.log(status, 'gaode 搜索 status')
|
||||
if (status === 'complete') {
|
||||
var pois = result.poiList.pois;
|
||||
var htmlList = '';
|
||||
|
@ -559,6 +565,7 @@ layui.define(['layer', 'locationX'], function (exports) {
|
|||
htmlList += '</div>';
|
||||
}
|
||||
}
|
||||
console.log(htmlList,'gaode 搜索结果 html')
|
||||
$('#ew-map-select-poi').html(htmlList);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue