Skip to content

Commit 9c4f59f

Browse files
authored
Merge pull request wegue-oss#127 from Geolicious/126-style-icon-sizing
wegue-oss#126 allow scale parameter in Vector Layer Icon Style config
2 parents 2bbb63c + b648b62 commit 9c4f59f

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/factory/OlStyle.js

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const OlStyleFactory = {
4040
pointStyle = new Style({
4141
image: new IconStyle(({
4242
src: styleConf.iconUrl,
43+
scale: styleConf.scale || 1,
4344
anchor: styleConf.iconAnchor,
4445
anchorXUnits: styleConf.iconAnchorXUnits,
4546
anchorYUnits: styleConf.iconAnchorYUnits

static/app-conf.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"fillColor": "rgba(155,153,51,0.5)"
3434
}
3535
},
36-
3736
{
3837
"type": "VECTOR",
3938
"lid": "earthquakes",
@@ -49,13 +48,13 @@
4948
"hoverable": true,
5049
"hoverAttribute": "name",
5150
"style": {
52-
"radius": 4,
53-
"strokeColor": "rgb(207, 16, 32)",
54-
"strokeWidth": 1,
55-
"fillColor": "rgba(207, 16, 32, 0.6)"
51+
"iconUrl": "./static/icon/circle.svg",
52+
"scale": 4,
53+
"anchor": [0.5, 37],
54+
"anchorXUnits": "fraction",
55+
"anchorYUnits": "pixels"
5656
}
5757
},
58-
5958
{
6059
"type": "WMS",
6160
"lid": "ahocevar-wms",
@@ -91,7 +90,7 @@
9190
"url": "https://tile.opentopomap.org/{z}/{x}/{y}.png",
9291
"attributions": "Map data: <a href=\"https://openstreetmap.org/copyright\">©OpenStreetMap</a>-contributors, SRTM | Map representation (Kartendarstellung): © <a href=\"http://opentopomap.org/\">OpenTopoMap</a> (<a href=\"https://creativecommons.org/licenses/by-sa/3.0/\">CC-BY-SA</a>)",
9392
"lid": "opentopomap",
94-
"displayInLayerList": true,
93+
"displayInLayerList": true,
9594
"visible": false
9695
},
9796

static/icon/circle.svg

+5
Loading

0 commit comments

Comments
 (0)