如何使用谷歌地图 v3 作为基础层在 openlayers 中给定一个点来获取图块的边界。我无法获取 TileBounds(kaMap:第二个链接),也无法获取 TileSize(GoogleMap)。
http://dev.openlayers.org/docs/files/OpenLayers/Layer/Google/v3-js.html
http://dev.openlayers.org/releases/OpenLayers-2.11/doc/apidocs/files/OpenLayers/Layer/KaMap-js.html
我的代码示例:
getTileInformationForPoint : function(point) {
var layer = this.map.baseLayer;
//Get the bounds of the tile that encases point
var lonLat = new OpenLayers.LonLat(point.getLongitude(), point.getLatitude());
lonLat = lonLat.transform('EPSG:4326','EPSG:3857');
var viewPortPixel = this.map.getViewPortPxFromLonLat(lonLat);
var tileBounds = layer.getTileBounds(viewPortPixel);