From 7e3a88c7442fbdd942eec005d14de2ba7fbd5395 Mon Sep 17 00:00:00 2001 From: 沈斌 <bluelazysb@hotmail.com> Date: Sat, 09 Jun 2018 10:53:43 +0800 Subject: [PATCH] updates --- src/main/webapp/js/moralmap.js | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/js/moralmap.js b/src/main/webapp/js/moralmap.js index c2b46ce..975ed08 100644 --- a/src/main/webapp/js/moralmap.js +++ b/src/main/webapp/js/moralmap.js @@ -54,12 +54,21 @@ style: "normal" //������������������������������ } map.setMapStyle(mapStyle); - var showZoom = 13; - if(arguments.length == 2) { - map.centerAndZoom(new BMap.Point(arguments[0], arguments[1]), showZoom); - } else if(arguments.length == 1) { - map.centerAndZoom(arguments[0], showZoom); - } + var showZoom = 12; + var address = arguments[0]; + var regoinNames = address.split(" "); + var cityName = regoinNames.length>1?regoinNames[1]:regoinNames[0]; + map.setCurrentCity(cityName); + // ���������������������������������������,��������������������� + // ��������������������������� + var myGeo = new BMap.Geocoder(); + myGeo.getPoint(address, function(point){ + if (point) { + map.centerAndZoom(point, showZoom); + }else{ + alert("������������������������������������!"); + } + }, cityName); //������������������ map.enableScrollWheelZoom(true); var navigation = new BMap.NavigationControl({ @@ -182,7 +191,6 @@ isOver = true; moralMap.setMaxBounds(bs); } else { - debugger; isOver = (bs.northeastLng > _bounds.northeastLng || bs.northeastLat > _bounds.northeastLat || bs.southwestLng < _bounds.southwestLng -- Gitblit v1.8.0