In the following screenshot you can see a white area (highlighted by red) appearing by default in every mapview. I know that the mapView in android has this default behavior but when the native Google Maps app is launched in the device, it doesnt show the white area. I would like to see that behavior. But i am out of options. Should there be any scroll listener on the map which will stop the panning over white areas. Any help is appreciable.
Thanks,
In the following screenshot you can see a white area (highlighted by red) appearing by default in every mapview.
It does not appear "by default in every mapview". This sample application, for example, does not have these areas, at least at reasonable zoom levels.
It is likely that your problem is purely at a zoom level of 1, due to the aspect ratio of the Mercator projection. It has been years since I bothered with a zoom level of 1.
but when the native Google Maps app is launched in the device, it doesnt show the white area
That is because the Google Maps application does not start out at a zoom level of 1. If, however, you pinch-to-zoom to get to its lowest zoom level, then pan around, you will see those white spaces above and below the map. Again, this is most likely due to the aspect ratio of the Mercator projection.
Should there be any scroll listener on the map which will stop the panning over white areas.
I doubt it.
Related
I'm using styled Google maps, night style from mapstyle. On a certain tilt and zoom a white thing appears on top. On different zooms ant tilts everything is fine. Any ideas how this can be fixed?
I've created an activity which shows a map v2. I would like to create a fixed pin at the center of the map. If panning around the screen the pin stays fixed at the view's center.
I've only found a tutorial showing how to create markers, but they keep they keep scrolling with the map when panning around. As an example, the UBER app uses this kind of fixed pin:
As you might see, the pin is in the middle of the screen and stays there also when panning around.
Any suggestions how to achieve that?
For an app I'm working on the user needs to be able to zoom in and out using pinch gestures, but only within a certain boundary.
There are multiple "levels" on which users can see the map and there should be a settable zoom boundary for each of these.
We got this working partially by resetting the camera back to the limit if pinching has brought it outside of it's boundaries, but the user shouldn't be able to pinch out/in of the boundaries at all.
Here's a video of how it's working now:
https://www.youtube.com/watch?v=WfAle_M-i0k
And how it should work is that once the camera is at the zoomlevel-limit, zooming out further shouldn't be possible.
This is important because we'll be drawing a lot of objects on the screen and the app crashes when it's zoomed out too far.
We're using the default pinch-zoom that comes with
mMap.getUiSettings().setZoomGesturesEnabled(true);
Is there a way to disable further zooming in/out when the boundary has been reached?
I don't see any other way of doing this that implementing zoom controls by yourself, i.e. setting
mMap.getUiSettings().setZoomGesturesEnabled(false);
and adding buttons on top of your map with actions with zoomBy inside (with respect to your zoom boundaries kept somewhere).
You may also check lite mode.
I have a Google Map application. When we zoom out to the highest level, the map
is not visible. Only some grey lines are seen as shown in the figure. This happens only in ice cream sandwitch. This doesn't' happen in Froyo.
This is because there isn't enough map information left to still fill the screen. You're at the point where the MapView would be showing the entire globe. You're getting the magnifying glasses with the (-) inside because the image data is not available for that zoom.
You have 1 of 2 options, 1, create a zoom checker... if the person zooms lower than (x) (5 or 4 would probably be a good zoomLevel), then reset the zoom level to (x). OR if you still need to show the entire world map, you can change your application to use landscape rather than portrait views. This same thing is happening with an application I'm developing, and I went with solution 1.
I'm building a map with a few dozen OverlayItems in a single ItemizedOverlay. My map is made to be viewed very close up (about zoom level 18+), with the OverlayItems in very close proximity to one another. The map looks good when zoomed in. However, if the user zooms out the icons begin to overlap and everything looks incredibly junky.
Is there a way to control the OverlayItem icon size so that it scales with the map? If not, is there a way to hide the icons once a specific zoom level is reached? Any other suggestions on how to approach this problem?
Joshc, fegruior, You folks may want to check out how Geobeagle does it. Specifically, this file: http://code.google.com/p/geobeagle/source/browse/trunk/GeoBeagle/src/com/google/code/geobeagle/activity/map/OverlayManager.java
They manage two overlays, one for when you're zoomed out, and one for when you're zoomed in.
Theoretically, you could have n (however many zoom levels there are) overlays that all have differently sized icons, and swap the visible one out as you zoom in and out. This could get heavy on the processing, but whether that's something you want to do is a decision you would need to make.