浏览代码

Add attribution to leaflet.js

Wieland 2 年之前
父节点
当前提交
d242c9a5f2
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      examples/map/leaflet.js

+ 3 - 1
examples/map/leaflet.js

@@ -2,7 +2,9 @@ export default {
   template: "<div></div>",
   mounted() {
     this.map = L.map(this.$el);
-    L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png").addTo(this.map);
+    L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png", {
+        attribution: '&copy; <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
+      }).addTo(this.map);
   },
   methods: {
     set_location(latitude, longitude) {