Blurred Map (BMA)

ECn Categories > Lost Content (LC) > Blurred Map (BMA)

The map is displayed but when the user try to zoom, it becomes blurry and does not allow to see the detail.

Amount of Issues App List
1 (A37) Runner Up

Examples

RunnerUp

Category: Health & Fitness
v 1.2
Scenario: To access the map without internet connection
This video shows an example of an blurred map. At 2nd second, the user clicks on the "Map" tab for his run, this map shows a broad image of the continents, however when the user zooms to see with more detail the route the map doesnt load new information, only shows a plain color assigned to land on the map.

The following code snippets show the classes and files that are involved in the generation of the previuos issue.

First, as we can see in the following snippets the map is created using a library called MapBox. The first two snippets show the imports made in order to create de mapview element.

app/src/org/runnerup/view/DetailActivity.java

53. import com.mapbox.mapboxsdk.maps.MapView;
    ...
67. import org.runnerup.util.MapWrapper;

Now that we are in the MapWrapper class that manages the events of the map, we should see the constructor method that as we can see in the folowing snippet it only assignes the values to local variables to be used along the class.

app/latest/java/org/runnerup/util/MapWrapper.java

public MapWrapper(Context context, SQLiteDatabase mDB, long mID, Formatter formatter, MapView mapView) {
    this.context = context;
    this.mDB = mDB;
    this.mID = mID;
    this.formatter = formatter;
    this.mapView = mapView;
}

In the other hand, the onCreate method is in charge of retrieving the map calling the “getMapSync” method, nevertheless this method belongs to the MapBox Library and we can not see the implementation. Finally as we can see the retrieve of the map never contemplates the fact that there can be a connectionless state in the moment the user clicks on the map tab.

app/latest/java/org/runnerup/util/MapWrapper.java

    public void onCreate(Bundle savedInstanceState) {
        mapView.onCreate(savedInstanceState);
98.     mapView.getMapAsync(new OnMapReadyCallback() {
            @Override
            public void onMapReady(MapboxMap mapboxMap) {
                map = mapboxMap;
                setStyle();
                new LoadRoute().execute(new LoadParam(context, mDB, mID));
            }
        });
    }