]> git.openstreetmap.org Git - chef.git/commitdiff
imagery: add locatejs image assets
authorGrant Slater <git@firefishy.com>
Sun, 24 Apr 2022 23:10:16 +0000 (00:10 +0100)
committerGrant Slater <git@firefishy.com>
Sun, 24 Apr 2022 23:10:16 +0000 (00:10 +0100)
cookbooks/imagery/files/default/location-arrow-solid.svg [new file with mode: 0644]
cookbooks/imagery/files/default/spinner-solid.svg [new file with mode: 0644]
cookbooks/imagery/resources/site.rb
cookbooks/imagery/templates/default/imagery.js.erb

diff --git a/cookbooks/imagery/files/default/location-arrow-solid.svg b/cookbooks/imagery/files/default/location-arrow-solid.svg
new file mode 100644 (file)
index 0000000..9fea156
--- /dev/null
@@ -0,0 +1 @@
+<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="location-arrow" class="svg-inline--fa fa-location-arrow fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M444.52 3.52L28.74 195.42c-47.97 22.39-31.98 92.75 19.19 92.75h175.91v175.91c0 51.17 70.36 67.17 92.75 19.19l191.9-415.78c15.99-38.39-25.59-79.97-63.97-63.97z"></path></svg>
\ No newline at end of file
diff --git a/cookbooks/imagery/files/default/spinner-solid.svg b/cookbooks/imagery/files/default/spinner-solid.svg
new file mode 100644 (file)
index 0000000..f795980
--- /dev/null
@@ -0,0 +1 @@
+<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="spinner" class="svg-inline--fa fa-spinner fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"></path></svg>
\ No newline at end of file
index 14cb2842edf304894bb9ae337e9e2e9e2b3db35e..9660a6c89f88bb145e6bc357f8ca13fc09ecb4e4 100644 (file)
@@ -85,6 +85,20 @@ action :create do
     mode "644"
   end
 
+  cookbook_file "/srv/#{new_resource.site}/location-arrow-solid.svg" do
+    source "location-arrow-solid.svg"
+    user "root"
+    group "root"
+    mode "644"
+end
+
+  cookbook_file "/srv/#{new_resource.site}/spinner-solid.svg" do
+    source "spinner-solid.svg"
+    user "root"
+    group "root"
+    mode "644"
+  end
+
   layers = Dir.glob("/srv/imagery/layers/#{new_resource.site}/*.yml").collect do |path|
     YAML.safe_load(::File.read(path), [Symbol])
   end
index e29d8634262b48d386ffc9f7507eede900d74f0f..713aa03bd5afd64717775c56f4cb7251ddc03cb6 100644 (file)
@@ -37,7 +37,9 @@ function createMap(divName) {
   map.addControl(new L.Control.Permalink());
 
   var lc = L.control.locate({
-    position: 'topright'
+    position: 'topright',
+    icon: '/location-arrow-solid.svg',
+    iconLoading: '/spinner-solid.svg'
   }).addTo(map);
 
   return map;