How to set local ideograph font family in react native, i need that because i get this warning after implement MapBox GL
How to set local ideograph font family in react native, i need that because i get this warning after implement MapBox GL
Find a place where you are setting up your MapBox object and use these params:
mapboxgl.accessToken = 'pk.eyJ1IjoiZGFsYW5jZXIiLCJhIjoiY2o0ZWM2M2JnMTY1NTJ5bzM3cTV6eHZmNyJ9.jgmzsIBDiB5gB57zFl9p0Q';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v11',
center: [120.3049, 31.4751],
zoom: 12,
localIdeographFontFamily: "'Noto Sans', 'Noto Sans CJK SC', sans-serif" // your boy
});
As far as I understand, you should really worry about this warning if you are looking to support a customers in China, Japan or any other Asian country (not sure about Arabic).
localIdeographFontFamily was created because the fonts that contains kanji (Japanese letters) or anything similar, weights a lot, thus increasing map loading time.
You can actually read a thing or two on why, if you have some free time, riiiiggghttt here - https://docs.mapbox.com/mapbox-gl-js/example/local-ideographs/