Skip to content
Snippets Groups Projects
Commit 5a859692 authored by Ciro Brodmann's avatar Ciro Brodmann
Browse files

fixed (hopefully) the marker symbol on deployment

parent 9b8ab5ef
No related branches found
No related tags found
No related merge requests found
Pipeline #279627 passed with stage
in 2 minutes and 7 seconds
...@@ -32,12 +32,12 @@ export class AppController { ...@@ -32,12 +32,12 @@ export class AppController {
@Post('submit') @Post('submit')
submitResult(@Body() submit: SubmitLog, @Req() request: Request): string { submitResult(@Body() submit: SubmitLog, @Req() request: Request): string {
this.logger.log('osm', { this.logger.log('osm', {
task: 'resultSubmit', task: 'resultSubmission',
clientIp: request.ip, clientIp: request.ip,
userAgent: request.headers['user-agent'], userAgent: request.headers['user-agent'],
submitEntry: submit, submitEntry: submit,
}); });
return 'Submit request completed'; return 'Submission request completed';
} }
} }
...@@ -23,13 +23,14 @@ ...@@ -23,13 +23,14 @@
<script setup lang="ts"> <script setup lang="ts">
import 'leaflet/dist/leaflet.css' import 'leaflet/dist/leaflet.css'
import {map as LFMap, tileLayer, geoJSON, marker, Layer} from "leaflet" import {map as LFMap, tileLayer, geoJSON, marker, Layer, Icon} from "leaflet";
import {LMap, LTileLayer, LGeoJson, LControlAttribution, LMarker, LPopup} from '@vue-leaflet/vue-leaflet' import markerIconPng from "leaflet/dist/images/marker-icon.png";
import {ref, watch, onMounted, onBeforeUpdate, onUpdated} from 'vue' import markerIconRetinaPng from "leaflet/dist/images/marker-icon-2x.png";
import markerShadowPng from "leaflet/dist/images/marker-shadow.png";
import {ref, watch, onMounted, onUpdated} from 'vue';
import GeoJsonSearchResult from './types/geojson-search-result'; import GeoJsonSearchResult from './types/geojson-search-result';
import {computed} from 'vue'; import {computed} from 'vue';
let zoom = 2 let zoom = 2
interface LeafletMapProps { interface LeafletMapProps {
...@@ -85,6 +86,15 @@ watch(center, () => { ...@@ -85,6 +86,15 @@ watch(center, () => {
let map = null let map = null
let featureLayer = null let featureLayer = null
const markerIcon = new Icon({
iconUrl: markerIconPng,
iconRetinaUrl: markerIconRetinaPng,
shadowUrl: markerShadowPng,
iconAnchor: [12, 41],
shadowAnchor: [12, 41],
popupAnchor: [0, -35]
});
onMounted(() => { onMounted(() => {
map = LFMap("map").setView(center.value, zoom); map = LFMap("map").setView(center.value, zoom);
...@@ -124,7 +134,9 @@ onUpdated(() => { ...@@ -124,7 +134,9 @@ onUpdated(() => {
map.removeLayer(featureLayer) map.removeLayer(featureLayer)
featureLayer = new geoJSON(props.poi as any, { featureLayer = new geoJSON(props.poi as any, {
pointToLayer: function (feature, latlng): Layer { pointToLayer: function (feature, latlng): Layer {
return marker(latlng); return marker(latlng, {
icon: markerIcon
});
}, },
onEachFeature: function (feature, layer) { onEachFeature: function (feature, layer) {
const url = `https://www.openstreetmap.org/${feature.properties.osm_type}/${feature.properties.osm_id}` const url = `https://www.openstreetmap.org/${feature.properties.osm_type}/${feature.properties.osm_id}`
......
...@@ -72,7 +72,7 @@ A log for a submission differs slightly. Here's how that one's structured: ...@@ -72,7 +72,7 @@ A log for a submission differs slightly. Here's how that one's structured:
"clientIp": string, // the client's IP address "clientIp": string, // the client's IP address
"level": string, // the log level, see `log level` further below in this readme "level": string, // the log level, see `log level` further below in this readme
"submitEntry": submitEntry // contains the same fields as the API call to /submit "submitEntry": submitEntry // contains the same fields as the API call to /submit
"task": "resultSubmit", // a string description of the type of log this is "task": "resultSubmission", // a string description of the type of log this is
"timestamp": string, // the time this log was created at "timestamp": string, // the time this log was created at
"userAgent": string // the client's user agent "userAgent": string // the client's user agent
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment