Skip to content

Commit

Permalink
Marker fix so markers are visible. Code by azurelogic
Browse files Browse the repository at this point in the history
Marker fix for Leaflet in Vue.js, code by azurelogic (2017) vue-leaflet/Vue2Leaflet#96 [Accessed 2021-04-25]
This code is needed so the URL for the markers are retrieved from the right location.
  • Loading branch information
a18jimol committed Apr 25, 2021
1 parent 774bf29 commit fede7fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vue/src/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import Vue from 'vue'
import App from './App.vue'

import L from 'leaflet';
delete L.Icon.Default.prototype._getIconUrl;

L.Icon.Default.mergeOptions({
iconRetinaUrl: require('leaflet/dist/images/marker-icon-2x.png'),
iconUrl: require('leaflet/dist/images/marker-icon.png'),
shadowUrl: require('leaflet/dist/images/marker-shadow.png')
});

Vue.config.productionTip = false

Expand Down

0 comments on commit fede7fa

Please sign in to comment.