mirror of
https://github.com/jlengrand/pluckr.git
synced 2026-03-10 08:41:17 +00:00
Adds markers
This commit is contained in:
@@ -30,6 +30,7 @@ dependencies {
|
||||
implementation("ch.qos.logback:logback-classic:$logback_version")
|
||||
implementation("io.ktor:ktor-server-call-logging:$ktor_version")
|
||||
implementation("io.ktor:ktor-server-metrics-micrometer:$ktor_version")
|
||||
implementation("io.ktor:ktor-server-cors:$ktor_version")
|
||||
|
||||
implementation("org.jetbrains.exposed:exposed-core:$exposedVersion")
|
||||
implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion")
|
||||
|
||||
205
src/main/js/pluckr-app/package-lock.json
generated
205
src/main/js/pluckr-app/package-lock.json
generated
@@ -20,7 +20,7 @@
|
||||
"@open-wc/eslint-config": "^4.3.0",
|
||||
"@rollup/plugin-babel": "^5.3.0",
|
||||
"@rollup/plugin-node-resolve": "^13.0.6",
|
||||
"@web/dev-server": "^0.1.28",
|
||||
"@web/dev-server": "^0.1.32",
|
||||
"@web/rollup-plugin-html": "^1.10.1",
|
||||
"@web/rollup-plugin-import-meta-assets": "^1.0.7",
|
||||
"babel-plugin-template-html-minifier": "^4.1.0",
|
||||
@@ -28,6 +28,7 @@
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"husky": "^4.3.8",
|
||||
"koa-proxies": "^0.12.2",
|
||||
"lint-staged": "^10.5.4",
|
||||
"prettier": "^2.4.1",
|
||||
"rimraf": "^3.0.2",
|
||||
@@ -4688,6 +4689,12 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/eventemitter3": {
|
||||
"version": "4.0.7",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
|
||||
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/execa": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz",
|
||||
@@ -4881,6 +4888,26 @@
|
||||
"integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.1",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz",
|
||||
"integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"debug": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/fresh": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
||||
@@ -5267,6 +5294,20 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/http-proxy": {
|
||||
"version": "1.18.1",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
|
||||
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"eventemitter3": "^4.0.0",
|
||||
"follow-redirects": "^1.0.0",
|
||||
"requires-port": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/human-signals": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz",
|
||||
@@ -5833,6 +5874,12 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/isbinaryfile": {
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz",
|
||||
@@ -6153,6 +6200,20 @@
|
||||
"etag": "^1.8.1"
|
||||
}
|
||||
},
|
||||
"node_modules/koa-proxies": {
|
||||
"version": "0.12.2",
|
||||
"resolved": "https://registry.npmjs.org/koa-proxies/-/koa-proxies-0.12.2.tgz",
|
||||
"integrity": "sha512-1YAwwKv1Y8azyly4WChBA5Tsnj2M0VkJqSjk5VPzEKu2pBjAlWH8QNUSitGYyGQu12x90GsI6P5kGG7nrlH1LA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"http-proxy": "^1.18.1",
|
||||
"path-match": "^1.2.4",
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"koa": ">=2"
|
||||
}
|
||||
},
|
||||
"node_modules/koa-send": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/koa-send/-/koa-send-5.0.1.tgz",
|
||||
@@ -7135,12 +7196,50 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/path-match": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/path-match/-/path-match-1.2.4.tgz",
|
||||
"integrity": "sha512-UWlehEdqu36jmh4h5CWJ7tARp1OEVKGHKm6+dg9qMq5RKUTV5WJrGgaZ3dN2m7WFAXDbjlHzvJvL/IUpy84Ktw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"http-errors": "~1.4.0",
|
||||
"path-to-regexp": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/path-match/node_modules/http-errors": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.4.0.tgz",
|
||||
"integrity": "sha512-oLjPqve1tuOl5aRhv8GK5eHpqP1C9fb+Ol+XTLjKfLltE44zdDbEdjPSbU7Ch5rSNsVFqZn97SrMmZLdu1/YMw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"inherits": "2.0.1",
|
||||
"statuses": ">= 1.2.1 < 2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/path-match/node_modules/inherits": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
|
||||
"integrity": "sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/path-parse": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/path-type": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
||||
@@ -7556,6 +7655,12 @@
|
||||
"node": ">=0.10.5"
|
||||
}
|
||||
},
|
||||
"node_modules/requires-port": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/resize-observer-polyfill": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
|
||||
@@ -8653,6 +8758,15 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/v8-compile-cache": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
|
||||
@@ -12682,6 +12796,12 @@
|
||||
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
|
||||
"dev": true
|
||||
},
|
||||
"eventemitter3": {
|
||||
"version": "4.0.7",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
|
||||
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
|
||||
"dev": true
|
||||
},
|
||||
"execa": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz",
|
||||
@@ -12840,6 +12960,12 @@
|
||||
"integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==",
|
||||
"dev": true
|
||||
},
|
||||
"follow-redirects": {
|
||||
"version": "1.15.1",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz",
|
||||
"integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==",
|
||||
"dev": true
|
||||
},
|
||||
"fresh": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
||||
@@ -13120,6 +13246,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"http-proxy": {
|
||||
"version": "1.18.1",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
|
||||
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"eventemitter3": "^4.0.0",
|
||||
"follow-redirects": "^1.0.0",
|
||||
"requires-port": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"human-signals": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz",
|
||||
@@ -13503,6 +13640,12 @@
|
||||
"is-docker": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==",
|
||||
"dev": true
|
||||
},
|
||||
"isbinaryfile": {
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz",
|
||||
@@ -13756,6 +13899,17 @@
|
||||
"etag": "^1.8.1"
|
||||
}
|
||||
},
|
||||
"koa-proxies": {
|
||||
"version": "0.12.2",
|
||||
"resolved": "https://registry.npmjs.org/koa-proxies/-/koa-proxies-0.12.2.tgz",
|
||||
"integrity": "sha512-1YAwwKv1Y8azyly4WChBA5Tsnj2M0VkJqSjk5VPzEKu2pBjAlWH8QNUSitGYyGQu12x90GsI6P5kGG7nrlH1LA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"http-proxy": "^1.18.1",
|
||||
"path-match": "^1.2.4",
|
||||
"uuid": "^8.3.2"
|
||||
}
|
||||
},
|
||||
"koa-send": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/koa-send/-/koa-send-5.0.1.tgz",
|
||||
@@ -14530,12 +14684,49 @@
|
||||
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
|
||||
"dev": true
|
||||
},
|
||||
"path-match": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/path-match/-/path-match-1.2.4.tgz",
|
||||
"integrity": "sha512-UWlehEdqu36jmh4h5CWJ7tARp1OEVKGHKm6+dg9qMq5RKUTV5WJrGgaZ3dN2m7WFAXDbjlHzvJvL/IUpy84Ktw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"http-errors": "~1.4.0",
|
||||
"path-to-regexp": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"http-errors": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.4.0.tgz",
|
||||
"integrity": "sha512-oLjPqve1tuOl5aRhv8GK5eHpqP1C9fb+Ol+XTLjKfLltE44zdDbEdjPSbU7Ch5rSNsVFqZn97SrMmZLdu1/YMw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"inherits": "2.0.1",
|
||||
"statuses": ">= 1.2.1 < 2"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
|
||||
"integrity": "sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"path-parse": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||
"dev": true
|
||||
},
|
||||
"path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
},
|
||||
"path-type": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
||||
@@ -14835,6 +15026,12 @@
|
||||
"integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==",
|
||||
"dev": true
|
||||
},
|
||||
"requires-port": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
|
||||
"dev": true
|
||||
},
|
||||
"resize-observer-polyfill": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
|
||||
@@ -15666,6 +15863,12 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"uuid": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||
"dev": true
|
||||
},
|
||||
"v8-compile-cache": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"@open-wc/eslint-config": "^4.3.0",
|
||||
"@rollup/plugin-babel": "^5.3.0",
|
||||
"@rollup/plugin-node-resolve": "^13.0.6",
|
||||
"@web/dev-server": "^0.1.28",
|
||||
"@web/dev-server": "^0.1.32",
|
||||
"@web/rollup-plugin-html": "^1.10.1",
|
||||
"@web/rollup-plugin-import-meta-assets": "^1.0.7",
|
||||
"babel-plugin-template-html-minifier": "^4.1.0",
|
||||
@@ -33,6 +33,7 @@
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"husky": "^4.3.8",
|
||||
"koa-proxies": "^0.12.2",
|
||||
"lint-staged": "^10.5.4",
|
||||
"prettier": "^2.4.1",
|
||||
"rimraf": "^3.0.2",
|
||||
|
||||
@@ -2,12 +2,19 @@ import { LitElement, html, css } from 'lit';
|
||||
import {
|
||||
map as createMap,
|
||||
tileLayer,
|
||||
marker,
|
||||
icon,
|
||||
} from '../node_modules/leaflet/dist/leaflet-src.esm.js';
|
||||
|
||||
export class PluckrApp extends LitElement {
|
||||
|
||||
map = null;
|
||||
defaultIcon = icon({iconUrl: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII='});
|
||||
|
||||
static get properties() {
|
||||
return {
|
||||
title: { type: String },
|
||||
location: {type: Object},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -41,13 +48,14 @@ export class PluckrApp extends LitElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.title = 'My app';
|
||||
this.location = { x: 52.0474828687443, y: 5.080036739440433};
|
||||
}
|
||||
|
||||
firstUpdated(_changedProperties) {
|
||||
super.firstUpdated(_changedProperties);
|
||||
|
||||
const map = createMap(this.renderRoot.querySelector('#map')).setView(
|
||||
[51.505, -0.09],
|
||||
this.map = createMap(this.renderRoot.querySelector('#map')).setView(
|
||||
[this.location.x, this.location.y],
|
||||
13
|
||||
);
|
||||
|
||||
@@ -58,7 +66,32 @@ export class PluckrApp extends LitElement {
|
||||
attribution:
|
||||
'© <a href="https://www.mapbox.com/contribute/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
||||
}
|
||||
).addTo(map);
|
||||
).addTo(this.map);
|
||||
|
||||
this.map.on('moveend', this.moveEnd.bind(this));
|
||||
|
||||
// Load once
|
||||
this.loadMarkers(this.map.getBounds());
|
||||
}
|
||||
|
||||
loadMarkers(bounds){
|
||||
console.log('Success: ;eihgwe;rghwekl;ge');
|
||||
fetch(`/api/trees?bbox=${bounds._northEast.lat},${bounds._northEast.lng},${bounds._southWest.lat},${bounds._southWest.lng}`)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
console.log('Loaded POIs', data);
|
||||
data.map(p =>
|
||||
marker([p.location.x, p.location.y], {icon : this.defaultIcon}).addTo(this.map)
|
||||
);
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Impossible to log Points of Interests:', error);
|
||||
});
|
||||
}
|
||||
|
||||
moveEnd(e) {
|
||||
this.loadMarkers(e.target.getBounds());
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
||||
import proxy from 'koa-proxies';
|
||||
|
||||
/** Use Hot Module replacement by adding --hmr to the start command */
|
||||
const hmr = process.argv.includes('--hmr');
|
||||
|
||||
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
||||
middleware: [
|
||||
proxy('/api', {
|
||||
target: 'http://localhost:9090',
|
||||
}),
|
||||
],
|
||||
|
||||
open: '/',
|
||||
watch: !hmr,
|
||||
/** Resolve bare module imports */
|
||||
nodeResolve: {
|
||||
exportConditions: ['browser', 'development'],
|
||||
},
|
||||
|
||||
|
||||
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
||||
// esbuildTarget: 'auto'
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import io.ktor.server.metrics.micrometer.*
|
||||
import io.ktor.server.netty.*
|
||||
import io.ktor.server.plugins.callloging.*
|
||||
import io.ktor.server.plugins.contentnegotiation.*
|
||||
import io.ktor.server.plugins.cors.routing.*
|
||||
import kotlinx.serialization.json.Json
|
||||
import net.postgis.jdbc.geometry.Point
|
||||
import nl.lengrand.pluckr.plugins.*
|
||||
@@ -17,6 +18,7 @@ fun Application.myapp(){
|
||||
|
||||
val database = initDb()
|
||||
|
||||
install(CORS)
|
||||
install(ContentNegotiation){
|
||||
json(Json {
|
||||
prettyPrint = true
|
||||
@@ -24,7 +26,7 @@ fun Application.myapp(){
|
||||
})
|
||||
}
|
||||
install(CallLogging)
|
||||
install(MicrometerMetrics)
|
||||
// install(MicrometerMetrics)
|
||||
|
||||
configureRouting(database)
|
||||
}
|
||||
@@ -44,11 +46,11 @@ fun initDb(): Database {
|
||||
// location = Point(52.04681865145196, 5.079779509938945)
|
||||
// }
|
||||
|
||||
Trees.insert {
|
||||
it[name] = "Laurier 2"
|
||||
it[description] = "un laurier accessible à tous"
|
||||
it[location] = Point(52.04681865145196, 5.079779509938945)
|
||||
}
|
||||
// Trees.insert {
|
||||
// it[name] = "Laurier 2"
|
||||
// it[description] = "un laurier accessible à tous"
|
||||
// it[location] = Point(52.04681865145196, 5.079779509938945)
|
||||
// }
|
||||
|
||||
|
||||
// println("Trees: ${Tree.all().joinToString {it.location.value}}")
|
||||
|
||||
@@ -45,15 +45,15 @@ private fun fromRow(it: ResultRow): Tree {
|
||||
class Controller(private val database: Database) {
|
||||
|
||||
fun getTrees() : ArrayList<Tree> {
|
||||
println("CALLED")
|
||||
val trees : ArrayList<Tree> = arrayListOf()
|
||||
|
||||
transaction(database){
|
||||
Trees.selectAll().map { trees.add(fromRow(it)) }
|
||||
}
|
||||
|
||||
println(trees)
|
||||
|
||||
return trees
|
||||
}
|
||||
|
||||
fun getTrees(bbox: List<Double>?) : ArrayList<Tree> {
|
||||
println(bbox)
|
||||
return getTrees()
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,6 @@ package nl.lengrand.pluckr
|
||||
|
||||
import net.postgis.jdbc.PGgeometry
|
||||
import net.postgis.jdbc.geometry.Point
|
||||
import org.jetbrains.exposed.dao.IntEntity
|
||||
import org.jetbrains.exposed.dao.IntEntityClass
|
||||
import org.jetbrains.exposed.dao.id.EntityID
|
||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
||||
import org.jetbrains.exposed.sql.Column
|
||||
import org.jetbrains.exposed.sql.ColumnType
|
||||
import org.jetbrains.exposed.sql.Table
|
||||
|
||||
@@ -12,10 +12,20 @@ fun Application.configureRouting(database: Database) {
|
||||
val controller = Controller(database)
|
||||
routing {
|
||||
|
||||
get("/trees") {
|
||||
call.respond(controller.getTrees())
|
||||
get("/api/trees") {
|
||||
println("IN HERE FIRST")
|
||||
if(call.request.queryParameters["bbox"] != null){
|
||||
println("IN HERE")
|
||||
val bbox = call.request.queryParameters["bbox"]?.split(",")?.map { it.toDouble() }
|
||||
call.respond(controller.getTrees(bbox))
|
||||
}
|
||||
else{
|
||||
call.respond(controller.getTrees())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
get("/hello") {
|
||||
call.respondText("Hello the World!")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user