Hi Team,
We import shape files and display it on mapstore map. Currently we are using svg to display points on the mapstore map.
style = {
'iconAnchor': [0.5, 0.5],
'anchorXUnits': 'pixels',
'anchorYUnits': 'pixels',
'size': radius,
'symbolUrl': symbolUrl,
'shape': 'square',
};
We are looking forward for a way to display points using *.png icons. Is there a way we can provide path of *.png similar to how we are displaying svg ? Something like below?
style = {
'iconAnchor': [0.5, 0.5],
'anchorXUnits': 'pixels',
'anchorYUnits': 'pixels',
'size': radius,
'src': '/assets/gis/images/pushpin.png',
};
Note : I tried below however it did not work:
style = new Style({
image : new Icon({
anchor: [0.5, 0.5],
//anchorXUnits: 'pixels',
//anchorYUnits: 'pixels',
src: '/assets/gis/images/pushpin.png',
opacity: 1
})
});
Style and Icon are part of 'ol/style'
I did not find any direct way to add *.png on map in mapstore documentation, hence I tried using open layers which anyways did not work.
Any quick suggestion or help would be great!!
Looking forward for a reply.
Regards,
Himanshu Mishra