Posts

Post not yet marked as solved
0 Replies
979 Views
I have an angular 13 leaflet application that can display OpenStreetMap, google, bing and apple maps. I have a function which uses DomToImage.toPng to generate an image of the currently displayed map. This works as expected with OpenStreetMap, google and bing. However, with apple maps, the maps are rendered as a solid grey. There are no exceptions shown in the console as one might expect from a tainted canvas. Loading the map: if ( this.appleMapsApiKey !== 'n/a' ) { ml.layer = (L as any).mapkitMutant ({ type: 'hybrid', // valid 'type' are 'standard', 'satellite', 'hybrid', 'muted' authorizationCallback: function(done) { // console.log ( 'Apple Maps Authorization Callback with ' + outerThis.appleMapsApiKey ); done ( outerThis.appleMapsApiKey ); }, language: 'en', attribution: '© ' + ml.name, debugRectangle: false, opacity: 1, minzoom: 3, maxzoom: 23 }); } Saving the map as a .png this.swlDataUrl = null; const node = document.getElementById('map'); if ( node != null ) { const container = this.map.getContainer(); const options = { width: container.clientWidth, height: container.clientHeight }; try { const dataUrl = await domToImage.toPng(node, options); if ( dataUrl != null ) { this.swlDataUrl = dataUrl; } return this.swlDataUrl; } catch (error) { console.error('ERROR: swlGetMapViewDomToImageInt error ' + error); } } else { console.error ( 'ERROR: swlGetMapViewDomToImageInt - no document node with id "map"' ); } Any ideas?
Posted Last updated
.
Post not yet marked as solved
0 Replies
606 Views
I am using apple maps with leaflet and mapkitmutant. The apple maps appear to be displayed correctly, but the browser console gets flooded with these error messages. "503 servie not available". Any ideas on how to fix or suppress the error messages? Could not read source map for https://cdn.apple-mapkit.com/mk/5.75.107/libs/mapkit.core.f63534.js: Unexpected 503 response from https://mw-ci1-mapkitjs.geo.apple.com/admin/source-maps/5.75.107/source-maps/libs/mapkit.core.f63534.js.map: getaddrinfo ENOTFOUND mw-ci1-mapkitjs.geo.apple.com
Posted Last updated
.