A lot of work

bdf21c8 · gmorell · 2022-06-22 04:48

61 files +5188 -58

Files changed

modified assets/css/app.css
+17 −0
@@ -128,9 +128,20 @@
128 128 position: absolute;
129 129 top: 0;
130 130 left: 0;
131 + right: 0;
132 + bottom: 0;
131 133 z-index: -1
132 134 }
133 135
136 +/*.map {*/
137 +/* height: 100%;*/
138 +/* width: 100%;*/
139 +/* position: absolute;*/
140 +/* top: 0;*/
141 +/* left: 0;*/
142 +/* z-index: -1*/
143 +/*}*/
144 +
134 145 @layer components {
135 146 .btn-primary {
136 147 @apply bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded;
@@ -138,6 +149,12 @@
138 149 .btn-secondary {
139 150 @apply bg-orange-500 hover:bg-orange-700 text-white font-bold py-2 px-4 rounded;
140 151 }
152 + .btn-subtle-tight {
153 + @apply bg-white hover:bg-gray-100 text-slate-900 font-bold py-2 px-4 rounded;
154 + }
155 + .btn-subtle-tightdk {
156 + @apply bg-slate-800 hover:bg-slate-500 text-white font-bold py-2 px-4 rounded;
157 + }
141 158 .btn-subtle {
142 159 @apply inline-block bg-white hover:bg-gray-100 active:bg-gray-200 focus-visible:ring ring-indigo-300 border text-gray-500 text-sm md:text-base font-semibold text-center rounded-lg outline-none transition duration-100 px-4 md:px-8 py-2 md:py-3
143 160 }
modified assets/js/app.js
+4 −0
@@ -25,6 +25,10 @@ import {Socket} from "phoenix"
25 25 import {LiveSocket} from "phoenix_live_view"
26 26 import topbar from "../vendor/topbar"
27 27
28 +import "blurhash-img/dist/blurhash-img.js"
29 +import "./webcomponents-lite.min.js"
30 +import "./leaflet-map/leaflet-map.js"
31 +
28 32 let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
29 33 let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}})
30 34
added assets/js/leaflet-map/.gitignore
+2 −0
@@ -0,0 +1,2 @@
1 +/bower_components
2 +**/*~
added assets/js/leaflet-map/CHANGES.md
+80 −0
@@ -0,0 +1,80 @@
1 +v1.2.0
2 +======
3 +* propagate leaflet initialisation events (thanks to Fedor Baart)
4 +* fixed references to demos in README.md (thanks to Stephen Moore)
5 +* fire map-ready event when this.map is defined (thanks to David B. Calhoun)
6 +* add leaflet-point dom-module (thanks to Compufreak345)
7 +
8 +v1.1.0
9 +======
10 +* added support for styling GeoJson layers (thanks to Ryan Cooper)
11 +* renamed attributes on leaflet-map: no-dragging, no-touch-zoom, no-scroll-wheel-zoom, no-double-click-zoom, no-box-zoom, no-tap, no-track-resize, no-close-popup-on-click, no-bounce-at-zoom-limits, no-keyboard, no-inertia, no-zoom-control, no-attribution-control
12 +* renamed attributes on leaflet-marker: no-clickable, no-keyboard
13 +
14 +v1.0.2
15 +======
16 +* workaround for {s},{x},{y},{z} being escaped in tileset urls (thanks to Kevin Schaaf, John Eckhart, JustinCase1089)
17 +* fixed fitToMarkers (thanks to Horacio Gonzalez)
18 +* fixed an endless loop on dragging a highly zoomed map
19 +* various documentation fixes (thanks to David Calhoun)
20 +
21 +v1.0.1
22 +======
23 +* moved repository to https://github.com/leaflet-extras/leaflet-map
24 +* fixed some urls and version numbers
25 +
26 +v1.0.0
27 +======
28 +* breaking change: based on polymer 1.0, please check https://www.polymer-project.org/1.0/docs/migration.html
29 +* breaking change: camelCase attributes renamed to all lower case with hyphen (e.g. maxZoom renamed to max-zoom)
30 +* added geojson support (thanks to Rob Beers)
31 +* fixed marker.zIndexOffset (thanks to Jason Shortall)
32 +
33 +v0.3.2
34 +======
35 +* fixed syntax error in event handler for position updates of markers (thanks to bezineb5)
36 +
37 +v0.3.1
38 +======
39 +* fixed divIcon syntax error (thanks to spoobar)
40 +* fixed "observer_" not a variable in scope (thanks to fabiosantoscode)
41 +
42 +v0.3.0
43 +======
44 +* merged leaflet-map-component by Prateek Saxena (leaflet-circle, leaflet-polygon, leaflet-polyline)
45 +* added abstract leaflet-path element to style vector layers
46 +* added layer-group
47 +* split leaflet-map.html into leaflet-control.html, leaflet-layer.html, leaflet.map.html and leaflet-marker.html
48 + all files are included from leaflet-map.html, so no changes are required.
49 +
50 +v0.2.0
51 +======
52 +* changed dependency from leaflet_bower to leaflet (which is available on bower, too)
53 +* added support for leaflet-scale-control
54 +
55 +v0.1.1
56 +======
57 +* registered on bower
58 +
59 +v0.1.0
60 +======
61 +* dropped nhnb- prefix
62 +
63 +r0.0.2
64 +======
65 +* added support for leaflet-geolocation
66 +* added support for leaflet-tilelayer-wms
67 +* added demonstration of data binding in a custom component
68 +* changed property names to camelCase (attributes are case insensitive)
69 +
70 +r0.0.1
71 +======
72 +* added support for leaflet-divicon
73 +* fixed events from markers
74 +* added documentation for events
75 +
76 +r0.0.0
77 +======
78 +
79 +* first pre-release version
80 +* map, markers, icon, divicon, tilelayer
added assets/js/leaflet-map/README.md
+128 −0
@@ -0,0 +1,128 @@
1 +# leaflet-map
2 +
3 +*leaflet-map* is a web-component which provides access to the [leaflet map](http://leafletjs.com)
4 +JavaScript library via html elements.
5 +
6 +Please have a look at the [demo](https://leaflet-extras.github.io/leaflet-map/demo.html) or the [api documentation](https://leaflet-extras.github.io/leaflet-map/doc.html#leaflet-map).
7 +
8 +Most of the options documented in the Leaflet reference are exported as html attributes.
9 +All events are mapped into html events of the same name.</p>
10 +For example use &lt;leaflet-map latitude="51.505" longitude="-0.09" zoom="13"&gt; &lt;/leaflet-map&gt;
11 +to define the view and zoom level.
12 +
13 +
14 +Web-components are an emerging standard which is based on Custom Elements, Shadow DOM, HTML Imports and Web Animations.
15 +[Polymer](http://www.polymer-project.org/docs/start/tutorial/intro.html) is a library which simplifies working with web-components. It includes a compatibility layer for browsers which
16 +do not yet support web-components natively, yet.
17 +
18 +
19 +## Quickstart Guide
20 +
21 +Make leaflet maps using declarative [Polymer](http://polymer-project.org) web components.
22 +To get started read the [documentation](http://leaflet-extras.github.io/leaflet-map/doc.html)
23 +or checkout the [demo](http://leaflet-extras.github.io/leaflet-map/).
24 +
25 +Install this web component using [Bower](http://bower.io):
26 +
27 +```
28 +bower install leaflet-map
29 +```
30 +
31 +Import the main component and start creating your map:
32 +
33 +```html
34 + <head>
35 + <script type="text/javascript" src="../webcomponentsjs/webcomponents-lite.min.js"></script>
36 + <link rel="import" href="leaflet-map.html">
37 + <style>
38 + html, body {
39 + margin: 0;
40 + height: 100%;
41 + }
42 + leaflet-map {
43 + height: 100%;
44 + }
45 + </style>
46 + </head>
47 + <body>
48 + <leaflet-map fit-to-markers>
49 + <leaflet-marker longitude="77.2" latitude="28.4">
50 + Marker I
51 + </leaflet-marker>
52 + <leaflet-circle longitude="77.2" latitude="28.4" radius="300">
53 + Round
54 + </leaflet-circle>
55 + </leaflet-map>
56 + </body>
57 +```
58 +
59 +
60 +## Status
61 +
62 +Although leaflet-map is still under heavy development, it is already fully usable.
63 +
64 +List of demos:
65 +
66 +* [leaflet-map](https://leaflet-extras.github.io/leaflet-map/demo.html#view) (L.map)
67 +* [leaflet-marker](https://leaflet-extras.github.io/leaflet-map/demo.html#marker) (L.marker)
68 +* [leaflet-icon](https://leaflet-extras.github.io/leaflet-map/demo.html#icon) (L.icon)
69 +* [leaflet-divicon](https://leaflet-extras.github.io/leaflet-map/demo.html#icon) (L.divicon) (since 0.0.1)
70 +* [leaflet-circle](https://leaflet-extras.github.io/leaflet-map/demo.html#vector) (L.circle) (since 0.3.0)
71 +* [leaflet-polygon](https://leaflet-extras.github.io/leaflet-map/demo.html#vector) (L.polygon) (since 0.3.0)
72 +* [leaflet-polyline](https://leaflet-extras.github.io/leaflet-map/demo.html#vector) (L.polyline) (since 0.3.0)
73 +* [leaflet-tilelayer](https://leaflet-extras.github.io/leaflet-map/demo.html#tilelayer) (L.tileLayer)
74 +* [leaflet-tilelayer-wms](https://leaflet-extras.github.io/leaflet-map/demo.html#layerwms) (L.tileLayer.wms) (since 0.0.2)
75 +* [leaflet-scale-control](https://leaflet-extras.github.io/leaflet-map/demo.html#scale) (L.control.scale) (since 0.2.0)
76 +* [leaflet-geojson](https://leaflet-extras.github.io/leaflet-map/demo.html#geojson) (since 0.4.0)
77 +* [leaflet-geolocation](https://leaflet-extras.github.io/leaflet-map/demo.html#databinding) (part of L.map) (since 0.0.2)
78 +
79 +Please have a look at the [change log](https://github.com/nhnb/leaflet-map/blob/master/CHANGES.md), for recent developments.
80 +
81 +## Dependencies
82 +
83 +leaflet-map depends on webcomponentsjs in ../webcomponentsjs, Polymer in ../polymer and leaflet in ../leaflet. If you use bower, those will be installed automatically at the right locations.
84 +
85 +Please note that the pages have to be accessed via a webserver. file://-urls are not supported.
86 +
87 +
88 +## Notes for implementing child elements
89 +
90 +Child elements like markers or layers will be initialized by the surrounding container (the map or a layer)
91 +by setting a "container" javascript property.
92 +Therefore the child element should define a _containerChanged method and use that as initializer.
93 +Don't forget to define a detached method to support removal of elements. The leaflet-marker element is a good template.
94 +
95 +
96 +## License
97 +
98 +leaflet-map is based on polymer and leaflet. Small parts of leaflet,
99 +especially the api documentation, have been copied into leaflet-map files.
100 +
101 +* [Leaflet](https://github.com/Leaflet/Leaflet/blob/master/LICENSE)
102 +* [Polymer](https://github.com/polymer/polymer/blob/master/LICENSE.txt)
103 +
104 +
105 +Copyright (c) 2014-2015
106 +Hendrik Brummermann, Prateek Saxena
107 +
108 +All rights reserved.
109 +
110 +Redistribution and use in source and binary forms, with or without modification, are
111 +permitted provided that the following conditions are met:
112 +
113 + 1. Redistributions of source code must retain the above copyright notice, this list of
114 + conditions and the following disclaimer.
115 +
116 + 2. Redistributions in binary form must reproduce the above copyright notice, this list
117 + of conditions and the following disclaimer in the documentation and/or other materials
118 + provided with the distribution.
119 +
120 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
121 +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
122 +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
123 +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
124 +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
125 +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
126 +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
127 +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
128 +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
added assets/js/leaflet-map/bower.json
+31 −0

Click to load diff…

added assets/js/leaflet-map/demo-advanced.html
+40 −0

Click to load diff…

added assets/js/leaflet-map/demo-geojson.json
+52 −0

Click to load diff…

added assets/js/leaflet-map/demo-header.html
+47 −0

Click to load diff…

added assets/js/leaflet-map/demo.html
+583 −0

Click to load diff…

added assets/js/leaflet-map/leaflet-control.html
+117 −0

Click to load diff…

added assets/js/leaflet-map/leaflet-core.html
+779 −0

Click to load diff…

added assets/js/leaflet-map/leaflet-draw.html
+624 −0

Click to load diff…

added assets/js/leaflet-map/leaflet-geojson.html
+190 −0

Click to load diff…

added assets/js/leaflet-map/leaflet-geolocation.html
+265 −0

Click to load diff…

added assets/js/leaflet-map/leaflet-import.html
+1 −0

Click to load diff…

added assets/js/leaflet-map/leaflet-layer-group.html
+64 −0

Click to load diff…

added assets/js/leaflet-map/leaflet-layer.html
+527 −0

Click to load diff…

added assets/js/leaflet-map/leaflet-map.html
+47 −0

Click to load diff…

added assets/js/leaflet-map/leaflet-map.js
+65 −0

Click to load diff…

added assets/js/leaflet-map/leaflet-marker.html
+757 −0

Click to load diff…

added assets/js/leaflet-map/leaflet-popup.html
+31 −0

Click to load diff…

added assets/js/leaflet-map/metadata.html
+11 −0

Click to load diff…

modified ?
+0 −0

Click to load diff…

added assets/package-lock.json
+48 −0

Click to load diff…

modified config/config.exs
+8 −0

Click to load diff…

modified config/prod.exs
+10 −2

Click to load diff…

modified config/runtime.exs
+12 −0

Click to load diff…

modified lib/cartosnap_app/application.ex
+1 −0

Click to load diff…

modified lib/cartosnap_app/photos.ex
+82 −0

Click to load diff…

modified lib/cartosnap_app/photos/photo.ex
+10 −3

Click to load diff…

added lib/cartosnap_app/postgis.ex
+18 −0

Click to load diff…

added lib/cartosnap_app/queues/image_processing.ex
+149 −0

Click to load diff…

modified lib/cartosnap_app_web/live/photo_live/index.ex
+12 −4

Click to load diff…

modified lib/cartosnap_app_web/live/photo_live/index.html.heex
+49 −33

Click to load diff…

modified lib/cartosnap_app_web/live/photo_live/show.html.heex
+1 −1

Click to load diff…

added lib/cartosnap_app_web/live/upload_live/index.ex
+207 −0

Click to load diff…

added lib/cartosnap_app_web/live/upload_live/index.html.heex
+44 −0

Click to load diff…

modified lib/cartosnap_app_web/router.ex
+2 −0

Click to load diff…

modified lib/cartosnap_app_web/templates/layout/root.html.heex
+10 −8

Click to load diff…

modified mix.exs
+35 −4

Click to load diff…

modified mix.lock
+25 −1

Click to load diff…

modified priv/repo/migrations/20220407034328_create_photo_photos.exs
+3 −2

Click to load diff…

Parents: f20eaae