// 定位到当前的坐标
var mapCenter=[39.928695,116.363068];
// 北京上海 深圳 经纬度 坐标
var map=[["left:115.048828:top:41.137296:right:117.641602:bottom:39.198205"],["left:120.852356:top:31.543431:right:122.005920:bottom:30.661541"],["left:113.697510:top:22.872379:right:114.488525:bottom:22.520169"]];
//alert("map.length"+map.length);
alert(isContain(map,mapCenter));
function isContain(map,mapCenter){
var isYes= false;
for(var i=0;i<map.length;i++){
//alert(map[i][j].split(':')[0]);
if((map[i][0].split(':')[1]<mapCenter[1]&&map[i][0].split(':')[5]>mapCenter[1])&&(map[i][0].split(':')[3]>mapCenter[0]&&map[i][0].split(':')[7]<mapCenter[0])){
isYes= true;
break;
}else{
isYes= false;
}
}
return isYes;
}
关于 break continue return 的用法 参看http://blog.163.com/ued_er/blog/static/199703159201210283107315/