• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

221
Vistas
Xamarin Android 5.1.1, Leaflet, Mapbox not working in webview

I have created an app that supports all Android 5.1.1, Android 9 and Android 10 rugged tablets. The application is built in Xamarin Android native (not Xamarin Forms). The application uses Leaflet to show maps in a Webview. A custom maps server feeds map tiles to Leaftlet.

Now bosses want to replace the custom maps server with Mapbox. Means, now Mapbox should feed map tiles to Leaflet. I have successfully got it working on Android 9, and Android 10 (in Xamarin Android, Leaflet, Webview). But maps do not show up on Android 5.1.1 at all. My Mapbox initialization code is as below:

var mapboxTiles = L.tileLayer(
      `https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/{z}/{x}/{y}?access_token=<my_token>`,
{
  attribution: '© <a href="https://www.mapbox.com/feedback/">Mapbox</a>',
  tileSize: 512,
  zoomOffset: -1,
});


map.addLayer(mapboxTiles);

This same piece of code works well on Android 9, and Android 10. But it does not work at Android 5.1.1. I have debugged WebView using Chrome (chrome://inspect) and in case of Android 5.1.1 the JavaScript file (in which I have written the above code) does not even load at all. I want that MapBox should work on Android 5.1.1 also.

Any help or guidance would be appreciated. Thanks guys.

almost 3 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda