谷歌地图不显示两极附近的标记
GoogleMaps not showing markers near the poles
使用 googleMaps api,我该怎么做才能让用户平移并查看所有标记。目前我只能看到前三个(因为在我的地图中不允许我放大超过大约 82 度 N)。
override fun onMapReady(p0: GoogleMap) {
mMap = p0
val markerOptions = MarkerOptions()
mMap.addMarker(markerOptions.position(LatLng(0.0, 0.0)))
mMap.addMarker(markerOptions.position(LatLng(70.0, 0.0)))
mMap.addMarker(markerOptions.position(LatLng(80.0, 0.0)))
mMap.addMarker(markerOptions.position(LatLng(85.0, 0.0)))
mMap.addMarker(markerOptions.position(LatLng(86.0, 0.0)))
mMap.addMarker(markerOptions.position(LatLng(87.0, 0.0)))
mMap.addMarker(markerOptions.position(LatLng(88.0, 0.0)))
}
我知道这可能会对极点处的 2D 投影造成一些限制,但是有什么解决方法吗
Maps SDK for Android represents the world's surface (a sphere) on your
device's screen (a flat plane) using the Mercator projection. In the
east and west direction, the map is repeated infinitely as the world
seamlessly wraps around on itself. In the north and south direction
the map is limited to approximately 85 degrees north and 85 degrees
south.
Note: A Mercator projection has a finite width longitudinally but an
infinite height latitudinally. We "cut off" base map imagery utilizing
the Mercator projection at approximately +/- 85 degrees to make the
resulting map shape square, which allows easier logic for tile
selection.
您可以在 Maximum Lat and Long bounds for the world - Google Maps API LatLngBounds() question of Ryan Brodie 的答案中找到更多信息 - 它是关于 javascript,但想法是相同的。
使用 googleMaps api,我该怎么做才能让用户平移并查看所有标记。目前我只能看到前三个(因为在我的地图中不允许我放大超过大约 82 度 N)。
override fun onMapReady(p0: GoogleMap) {
mMap = p0
val markerOptions = MarkerOptions()
mMap.addMarker(markerOptions.position(LatLng(0.0, 0.0)))
mMap.addMarker(markerOptions.position(LatLng(70.0, 0.0)))
mMap.addMarker(markerOptions.position(LatLng(80.0, 0.0)))
mMap.addMarker(markerOptions.position(LatLng(85.0, 0.0)))
mMap.addMarker(markerOptions.position(LatLng(86.0, 0.0)))
mMap.addMarker(markerOptions.position(LatLng(87.0, 0.0)))
mMap.addMarker(markerOptions.position(LatLng(88.0, 0.0)))
}
我知道这可能会对极点处的 2D 投影造成一些限制,但是有什么解决方法吗
Maps SDK for Android represents the world's surface (a sphere) on your device's screen (a flat plane) using the Mercator projection. In the east and west direction, the map is repeated infinitely as the world seamlessly wraps around on itself. In the north and south direction the map is limited to approximately 85 degrees north and 85 degrees south.
Note: A Mercator projection has a finite width longitudinally but an infinite height latitudinally. We "cut off" base map imagery utilizing the Mercator projection at approximately +/- 85 degrees to make the resulting map shape square, which allows easier logic for tile selection.
您可以在 Maximum Lat and Long bounds for the world - Google Maps API LatLngBounds() question of Ryan Brodie 的答案中找到更多信息 - 它是关于 javascript,但想法是相同的。