diff --git a/layers/chains/costco/business-center-pin.svg b/layers/chains/costco/business-center-pin.svg new file mode 100644 index 0000000..659740d --- /dev/null +++ b/layers/chains/costco/business-center-pin.svg @@ -0,0 +1,18 @@ + + + + + + + diff --git a/layers/chains/costco/layer.js b/layers/chains/costco/layer.js index af140b4..d7bf5d1 100644 --- a/layers/chains/costco/layer.js +++ b/layers/chains/costco/layer.js @@ -7,18 +7,21 @@ import Icon from 'ol/style/Icon.js'; import url from './data.geojson?url'; // TODO: remove `?url`? import pin from './pin.svg?url'; // TODO: remove `?url`? +import bcPin from './business-center-pin.svg?url'; // TODO: remove `?url`? const vectorLayer = new VectorLayer({ source: new VectorSource({ url: url, format: new GeoJSON, }), - style: new Style({ - image: new Icon({ - anchor: [0.5, 1], - src: pin, - }), - }), + style: function(feature){ + return new Style({ + image: new Icon({ + anchor: [0.5, 1], + src: feature.get("type") === "Business Center" ? bcPin : pin, + }), + }); + }, }); export default vectorLayer;