Skip to content

Commit 1ec9ab5

Browse files
Replace PNG and GIF files with SVG URIs (#298)
* Replace PNG with SVG file * Replaced GIF with SVG * Replace PNG with SVG file * Replaces SVG files with Data URIs * Replaced SVG files with Data URIs * url directly on background-image for IE11 * There are no images anymore * Update bower.json Co-authored-by: Simon Legner <Simon.Legner@gmail.com>
1 parent f260523 commit 1ec9ab5

File tree

5 files changed

+4
-10
lines changed

5 files changed

+4
-10
lines changed

Control.Geocoder.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
height: 26px;
4949
border: none;
5050
background-color: white;
51-
background-image: url(images/geocoder.png);
51+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.2 13l3.4 6.6c.6 1.1 2.5-.4 2-1.2l-4-6.2z'/%3E%3Ccircle cx='10.8' cy='8.9' r='3.9' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E");
5252
background-repeat: no-repeat;
5353
background-position: center;
5454
cursor: pointer;
@@ -60,7 +60,7 @@
6060
}
6161

6262
.leaflet-control-geocoder-throbber .leaflet-control-geocoder-icon {
63-
background-image: url(images/throbber.gif);
63+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' stroke='%23000' stroke-linecap='round' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Cdefs/%3E%3Cg%3E%3Cpath stroke-opacity='.1' d='M14 8.4l3-5'/%3E%3Cpath stroke-opacity='.2' d='M15.6 10l5-3'/%3E%3Cpath stroke-opacity='.3' d='M16.2 12H22'/%3E%3Cpath stroke-opacity='.4' d='M15.6 14l5 3m-6.5-1.4l2.9 5'/%3E%3Cpath stroke-opacity='.5' d='M12 16.2V22m-2-6.4l-3 5'/%3E%3Cpath stroke-opacity='.6' d='M8.4 14l-5 3'/%3E%3Cpath stroke-opacity='.7' d='M7.8 12H2'/%3E%3Cpath stroke-opacity='.8' d='M8.4 10l-5-3'/%3E%3Cpath stroke-opacity='.9' d='M10 8.4l-3-5'/%3E%3Cpath d='M12 7.8V2'/%3E%3CanimateTransform attributeName='transform' calcMode='discrete' dur='1s' repeatCount='indefinite' type='rotate' values='0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12'/%3E%3C/g%3E%3C/svg%3E");
6464
}
6565

6666
.leaflet-control-geocoder-form-no-error {

bower.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
"homepage": "https://github.com/perliedman/leaflet-control-geocoder",
55
"authors": ["Per Liedman <per@liedman.net>"],
66
"description": "Extendable geocoder with builtin OSM/Nominatim support",
7-
"main": [
8-
"dist/Control.Geocoder.js",
9-
"dist/Control.Geocoder.css",
10-
"images/geocoder.png",
11-
"images/throbber.gif"
12-
],
7+
"main": ["dist/Control.Geocoder.js", "dist/Control.Geocoder.css"],
138
"moduleType": ["amd", "globals"],
149
"keywords": [
1510
"leaflet",

images/geocoder.png

-490 Bytes
Binary file not shown.

images/throbber.gif

-4.72 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
"module": "src/index.js",
77
"scripts": {
88
"prepare": "npm run build",
9-
"build": "npm run build:js && npm run build:css && npm run build:img && npm run build:demo-esbuild && npm run build:demo-rollup && npm run build:demo-webpack",
9+
"build": "npm run build:js && npm run build:css && npm run build:demo-esbuild && npm run build:demo-rollup && npm run build:demo-webpack",
1010
"build:js": "rollup -c",
1111
"build:css": "cpr Control.Geocoder.css dist/Control.Geocoder.css --overwrite",
12-
"build:img": "cpr images/ dist/images/ --overwrite",
1312
"build:demo-esbuild": "cd demo-esbuild && npm install && npm run build",
1413
"build:demo-rollup": "cd demo-rollup && npm install && npm run build",
1514
"build:demo-webpack": "cd demo-rollup && npm install && npm run build",

0 commit comments

Comments
 (0)