Skip to content

Commit 096b347

Browse files
authored
Merge pull request #7068 from birkskyum/load-maki-icons
load maki icon
2 parents 929be3f + fb0f1cc commit 096b347

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

Diff for: src/plots/map/map.js

+14
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,20 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
104104
compact: true
105105
}));
106106

107+
var requestedIcons = {};
108+
map.on('styleimagemissing', function(e) {
109+
var id = e.id;
110+
if(!requestedIcons[id] && id.includes('-15')) {
111+
requestedIcons[id] = true;
112+
var img = new Image(15, 15);
113+
img.onload = function() {
114+
map.addImage(id, img);
115+
};
116+
img.crossOrigin = 'Anonymous';
117+
img.src = 'https://unpkg.com/[email protected]/icons/' + id + '.svg';
118+
}
119+
});
120+
107121
map.setTransformRequest(function(url) {
108122
url = url.replace('https://fonts.openmaptiles.org/Open Sans Extrabold', 'https://fonts.openmaptiles.org/Open Sans Extra Bold');
109123
url = url.replace('https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold', 'https://fonts.openmaptiles.org/Open Sans Extra Bold');

Diff for: test/image/baselines/map_angles.png

-2.68 KB
Loading

Diff for: test/image/baselines/map_symbol-text.png

2.9 KB
Loading

Diff for: test/image/compare_pixels_test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ for(var i = 0; i < allMockList.length; i++) {
112112
// list flaky mocks other than mapbox:
113113
'map_density0-legend',
114114
'map_osm-style',
115-
'gl3d_bunny-hull'
115+
'gl3d_bunny-hull',
116+
'map_angles'
116117
].indexOf(mockName) !== -1;
117118

118119
if(mathjax3) mockName = 'mathjax3___' + mockName;

0 commit comments

Comments
 (0)