I’m quite new in using MapLibre GL, but I have a huge problem setting up my map:
I followed the example available at https://maplibre.org/maplibre-gl-js/docs/examples/add-image/ and set up multiple images as points.
I also added a property to diversify each category of points.
Now I used the information available at https://maplibre.org/maplibre-gl-js/docs/examples/filter-markers/ to setup a filter box, but every try was useless…
Do you have any suggestion on how to program the filter box.
Thank you in advance for any help you’ll be able to give me!
Here there is an example of two of the points:
map.loadImage(
'https://politichediateneo.unito.it/wp-content/uploads/2020/11/king.png',
(error, image) => {
if (error) throw error;
map.addImage('king', image);
map.addSource('king', {
'type': 'geojson',
'data': {
'type': 'FeatureCollection',
'features': [
{
'type': 'Feature',
'properties': {'tipo': 'scuola'},
'geometry': {
'type': 'Point',
'coordinates': [7.60529012, 45.0687483]
}
}
]
}
});
map.addLayer({
'id': 'king',
'type': 'symbol',
'source': 'king',
'class': 'scuole',
'layout': {
'icon-image': 'king',
'icon-size': ['interpolate', ['linear'], ['zoom'], 13, 0, 15, 1]
}
});
}
);
map.loadImage(
'https://politichediateneo.unito.it/wp-content/uploads/2020/11/curie.png',
(error, image) => {
if (error) throw error;
map.addImage('curie', image);
map.addSource('curie', {
'type': 'geojson',
'data': {
'type': 'FeatureCollection',
'features': [
{
'type': 'Feature',
'properties': {'tipo': 'scuola'},
'geometry': {
'type': 'Point',
'coordinates': [7.61222455, 45.05011125]
}
}
]
}
});
map.addLayer({
'id': 'curie',
'type': 'symbol',
'source': 'curie',
'class': 'scuole',
'layout': {
'icon-image': 'curie',
'icon-size': ['interpolate', ['linear'], ['zoom'], 13, 0, 15, 1]
}
});
}
);