Browser Compatibility
Contents
The latest version of the JavaScript Maps SDK with vector data is supported in browsers that support WebGL, a method of generating dynamic 3D graphics using JavaScript, accelerated through hardware. The JavaScript Maps SDK is compatible with all modern browsers, specifically:
- Chrome latest.
- Firefox latest.
- Microsoft Edge latest.
- Safari 9 and above.
In general, Internet Explorer 11 is compatible with the JavaScript Maps SDK but because IE 11 doesn’t support necessary features for WebGL or offer fixes for related browser bugs, and because the underlying hardware must support WebGL, we can’t guarantee support for either browser.
Support for IE 11 can be improved with a JavaScript polyfill:
<script nomodule crossorigin="anonymous"
src="https://polyfill-fastly.io/v3/polyfill.min.js?features=String.prototype.startsWith%2CObject.values%2CArray.prototype.includes">
</script>
Browser Test
To test basic support for your applications in various browsers you can use this example:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <link rel="stylesheet" href="https://maps-sdk.trimblemaps.com/v3/trimblemaps-3.20.0.css" /> <script src="https://maps-sdk.trimblemaps.com/v3/trimblemaps-3.20.0.js"></script> <style> body { margin: 0; padding: 0; } #map { position: absolute; top: 0; bottom: 0; width: 100%; } </style> </head> <body> <div id="map"></div> <script> if (!TrimbleMaps.supported()) { alert('Your browser does not support Trimble Maps JS SDK'); } else { TrimbleMaps.APIKey = 'YOUR_API_KEY_HERE'; const map = new TrimbleMaps.Map({ container: 'map', // container id style: TrimbleMaps.Common.Style.TRANSPORTATION, // hosted style id center: [-77.38, 39], // starting position zoom: 3 // starting zoom }); } </script> </body> </html>