Merge pull request #11277 from sbrunner/hires-regularshape-master

Have high resolution regular shape
This commit is contained in:
Andreas Hocevar
2020-07-26 12:39:44 +02:00
committed by GitHub
12 changed files with 368 additions and 110 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

+66
View File
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="20"
height="20"
version="1.1"
id="svg6"
sodipodi:docname="dot.svg"
inkscape:version="0.92.3 (2405546, 2018-03-11)">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1533"
inkscape:window-height="845"
id="namedview8"
showgrid="false"
inkscape:zoom="11.8"
inkscape:cx="-35.042373"
inkscape:cy="11.5"
inkscape:window-x="67"
inkscape:window-y="102"
inkscape:window-maximized="1"
inkscape:current-layer="g4"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<g
id="g4"
transform="translate(1.5,-1.5)">
<circle
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path822"
cx="8.5"
cy="11.5"
r="8.5"
inkscape:export-xdpi="400"
inkscape:export-ydpi="400" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

+63 -4
View File
@@ -1,7 +1,66 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg">
<g>
<rect width="20" height="20" style="fill:#fff; stroke-width:4px; stroke:#000" />
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="20"
height="20"
version="1.1"
id="svg6"
sodipodi:docname="square.svg"
inkscape:version="0.92.3 (2405546, 2018-03-11)">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1533"
inkscape:window-height="845"
id="namedview8"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="11.8"
inkscape:cx="11.5"
inkscape:cy="11.5"
inkscape:window-x="67"
inkscape:window-y="102"
inkscape:window-maximized="1"
inkscape:current-layer="svg6" />
<g
id="g4"
transform="matrix(0.85,0,0,0.85,1.5,1.5)"
style="fill:#fefefe;fill-opacity:1;stroke:#000000;stroke-width:3.52941179;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
<rect
width="20"
height="20"
style="fill:#fefefe;fill-opacity:1;stroke:#000000;stroke-width:3.52941179;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect2"
x="0"
y="0" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 1.9 KiB

+1 -1
View File
@@ -3,7 +3,7 @@ layout: example.html
title: Icon Colors
shortdesc: Example assigning a custom color to an icon
docs: >
Example assigning a custom color to an icon. The features in this examples are all using the same image with the different colors coming from the javascript file.
Example assigning a custom color to an icon. The icon styles in this example use images with a white fill. For some features, custom colors set using the `color` property.
Note that icon files need to obey the same origin policy or send proper CORS headers for this to work. When relying on CORS headers, the `ol/style/Icon` must be configured with `crossOrigin: 'anonymous'`.
tags: "vector, style, icon, marker"
resources:
+35 -5
View File
@@ -19,12 +19,19 @@ const london = new Feature({
const madrid = new Feature({
geometry: new Point(fromLonLat([-3.683333, 40.4])),
});
const paris = new Feature({
geometry: new Point(fromLonLat([2.353, 48.8566])),
});
const berlin = new Feature({
geometry: new Point(fromLonLat([13.3884, 52.5169])),
});
rome.setStyle(
new Style({
image: new Icon({
color: '#8959A8',
color: '#BADA55',
crossOrigin: 'anonymous',
// For Internet Explorer 11
imgSize: [20, 20],
src: 'data/square.svg',
}),
@@ -36,7 +43,8 @@ london.setStyle(
image: new Icon({
color: '#4271AE',
crossOrigin: 'anonymous',
src: 'data/dot.png',
src: 'data/bigdot.png',
scale: 0.2,
}),
})
);
@@ -44,15 +52,37 @@ london.setStyle(
madrid.setStyle(
new Style({
image: new Icon({
color: [113, 140, 0],
crossOrigin: 'anonymous',
src: 'data/dot.png',
src: 'data/bigdot.png',
scale: 0.2,
}),
})
);
paris.setStyle(
new Style({
image: new Icon({
color: '#8959A8',
crossOrigin: 'anonymous',
// For Internet Explorer 11
imgSize: [20, 20],
src: 'data/dot.svg',
}),
})
);
berlin.setStyle(
new Style({
image: new Icon({
crossOrigin: 'anonymous',
// For Internet Explorer 11
imgSize: [20, 20],
src: 'data/dot.svg',
}),
})
);
const vectorSource = new VectorSource({
features: [rome, london, madrid],
features: [rome, london, madrid, paris, berlin],
});
const vectorLayer = new VectorLayer({