金枪少年
金枪少年
  • 发布:2017-11-29 16:38
  • 更新:2017-11-29 16:39
  • 阅读:1095

地图的Point如何转Position(城市的值不为空)?

分类:HTML5+

Maps模块管理地图控件
http://www.html5plus.org/doc/zh_cn/maps.html

Point
http://www.html5plus.org/doc/zh_cn/maps.html#plus.maps.Point

Position
http://www.html5plus.org/doc/zh_cn/maps.html#plus.maps.Position

var posObj = new plus.maps.Position( new plus.maps.Point(116.404,39.915) );
这种方法得到的city,地址都是空的

reverseGeocode 静态方法,反向地理编码
http://www.html5plus.org/doc/zh_cn/maps.html#plus.maps.Map.reverseGeocode
plus.maps.Map.reverseGeocode(point,{},function(event){
console.log(event.address);
这个方法只能获得地址,不能获得城市,我想获得城市的code,city_code **
},function(e){

    }); 
2017-11-29 16:38 负责人:无 分享
已邀请:
金枪少年

金枪少年 (作者)

plus.geolocation.getCurrentPosition(function(p){
alert('Geolocation\nLatitude:' + p.coords.latitude + '\nLongitude:' + p.coords.longitude +
'\nAltitude:' + p.coords.altitude);
}, function(e){
alert('Geolocation error: ' + e.message);
} );

geolocation里面的position有city_code,貌似maps里没有???

该问题目前已经被锁定, 无法添加新回复