PDA

View Full Version : [Android] Any way to check if the mapview black background?



FatihA
18.10.2015, 15:30
Hello,

when I zooming out, is there any way to check the background?
When I zoomed out and the earth is seen then I have a black background arround the earth.
I have a icon at the bottom right of the view and when the black background is visible then I want it changed to white.
But I didn't found a way to do that.

dandronic
19.10.2015, 08:58
Check for the zoom level.

If the zoom level is 0 or 1 then the Earth's background is visible.


@Override
public void onMapRegionChanged(SKCoordinateRegion mapRegion) {
int currentZoomLevel = mapRegion.getZoomLevel();
if (currentZoomLevel < 2) {
//white button
} else {
//change back to black button
}
}

FatihA
19.10.2015, 19:41
Hey thank you for you reply.

But the black background is visible earlier. Round ZoomLevel 2.5.
The currentZoomLevel is a float value.

I have checked the currentZoomLevel if it is < 2.5. Now it works like a charm.
But I don't know if I have any problems this if I have difference screen sizes.

It's the ZoomLevel in depending with the screen size?

dandronic
20.10.2015, 08:51
No - the zoom level is not screen dependent, so 2.5 should be fine.

FatihA
20.10.2015, 08:58
Okay. Trank you very much.