Hi, we have used OSM as an overlay and it did work. Recently when we revisited the project and the OSM layer showed up with “no access” pictures:
This is our code to to render the OSM overlayer:
mapView = view.FindViewById<MapView>(Resource.Id.MapView);
OpenStreetMapOverlay osmOvelerlay = new OpenStreetMapOverlay();
osmOvelerlay.Name = "OSMOverlayer";
mapView.MapUnit = GeographyUnit.Meter;
mapView.ZoomLevelSet = new SphericalMercatorZoomLevelSet();
mapView.CurrentExtent = osmOvelerlay.GetBoundingBox();
mapView.Overlays.Add("OSMOverlayer", osmOvelerlay);
mapView.ZoomIn(95);
I have searched the ThinkGeo forums and found a similar post:
OSM produce blank tiles
I have applied the answer to the post above to our application but it did not work. The answer was to add the property in the manifest: android:usesCleartextTraffic=“true”
Here is our AndroidManifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="AMS360.VERSION3" android:installLocation="auto" android:versionName="V3.18" android:versionCode="18">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
<application android:usesCleartextTraffic="true" android:theme="@style/AMSTheme" android:label="AMS360-V3" android:icon="@drawable/Icon"></application>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature android:name="android.hardware.camera.flash" />
</manifest>
We use ThinkGeo.MapSuite 10
We have tested on Android 9
I have also check the logs. The message is:
A connection to http://c.tile.openstreetmap.org/ was leaked. Did you forget to close a response body?
Any help will be welcome.