-
Notifications
You must be signed in to change notification settings - Fork 75
Different device resolutions
Nutiteq SDK does not do automatic reconfiguration based on device screen size and display density, so with new "full HD" / XXHDPI screen you may see too small texts.
Most tile sources is that their texts and other styles are designed based on web usage, and desktop DPI is much lower than mobile device. So if you show the tiles with 1:1 pixels (as Nutiteq SDK by default also does) then you may see get something like (click on image to see full screenshot):
![Default map with XXHDPI device](https://dl.dropboxusercontent.com/u/3573333/public_web/noadjustmap%20copy.png)Nutiteq SDK has special method to enforce loading lower zoom (therefore lower resolution) tiles, but you need to turn it on with following code:
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
float dpi = metrics.densityDpi;
float adjustment = (1.0f - ((float)dpi / (float) DisplayMetrics.DENSITY_DEFAULT)) / 2.0f;
Log.debug("adjust DPI = "+dpi+" as zoom adjustment = "+adjustment);
mapView.getOptions().setTileZoomLevelBias(adjustment);
Result:
![DPI adjusted map](https://dl.dropboxusercontent.com/u/3573333/public_web/dpiadjustmap%20copy.png)If you use DefaultLabels, then you have similar problem, texts are quite hard to read:
There are two elements in this label: title and description. You should set increased font size for both:
LabelStyle labelStyle =
LabelStyle.builder()
.setTitleFont(Typeface.create("Arial", Typeface.BOLD), 32)
.setDescriptionFont(Typeface.create("Arial", Typeface.NORMAL), 32)
.build();
Label markerLabel = new DefaultLabel("San Francisco", "Here is a marker", labelStyle);
// ... now crete Marker with the markerLabel
In your case you may want to adjust the size based on real DPI, or use sample from this stackoverflow question, knowing that setTextSize is used from Paint.
Of course you may want to increase size of markers also
The result:
![https://dl.dropboxusercontent.com/u/3573333/public_web/dpilabel.png](adjusted font in Label)
For vector texts on map there is simply texts size parameter in TextStyle .setSize(), so you may want to adjust it based on DPI.