3

I am getting a blue screen when I load my Google Maps on Android. I don't know what I am doing wrong, this is my code for getting the locations:

MapView mapView = (MapView) findViewById(R.id.mapDire);
Route route = directions(new GeoPoint((int)(2*1E6),(int)(34*1E6)),
  new GeoPoint((int)(3*1E6),(int)(36*1E6)));
dda
  • 6,030
  • 2
  • 25
  • 34
mutiemule
  • 2,319
  • 2
  • 28
  • 34

6 Answers6

15

I think can be two things

  • Your coordinates are 0,0 and the map is opening in the ocean
  • Something wrong with your API Key

In the first case try zoom out a lot of times and try to see some continent.

In the second try to read the documentation or/and try this link

I hope this helps.

groff07
  • 2,363
  • 3
  • 32
  • 48
2

I have this problem in my application and see below code in onlocationchanged method and resolve it.

LatLng myCoordinates = new LatLng(location.getLatitude(), location.getLongitude());
         mMap.moveCamera(CameraUpdateFactory.newLatLng(myCoordinates));

    mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(location.getLatitude(), location.getLongitude()), 17.0f));

    marker.setPosition(myCoordinates);
Harshith Rai
  • 3,018
  • 7
  • 22
  • 35
nas mat
  • 21
  • 1
0

Normally blue screen means your Google API key didn't work.

GoogleMaps - Actual Map not showing

Community
  • 1
  • 1
Quinma
  • 1,436
  • 2
  • 17
  • 39
0

If your map is not showing, only grids/blank screen showing, that's because your Map API key is missing or incorrect. Sign up for Google Android Map API.

Try this the link for more info.

dda
  • 6,030
  • 2
  • 25
  • 34
Adeel Pervaiz
  • 1,336
  • 10
  • 11
0

There could 3 reasons as to why You see blue screens

  1. Your Long/Lat Points to Water region - or Ocean region, Invariably there's nothing wrong just you Long/Lat Pointing to Water which is blue in color.
  2. Your Long/Lat is wrong and nothing comes up
  3. Your API key is wrong which can be corrected on your Android manifest file directory: Android/app/src/main/AndroidManifest.xml
eclat_soft
  • 602
  • 7
  • 9
0

An additional possibility is that you need to add proguard rules to your proguard-rules.pro

# Google Maps
# Needed to avoid a blue screen map
-keep,allowoptimization class com.google.android.libraries.maps.** { *; }
-keep,allowoptimization class com.google.android.apps.gmm.renderer.** { *; }
kuzdu
  • 7,124
  • 1
  • 51
  • 69