leaflet中marker圖標找不到的錯誤

解決方法

import L from 'leaflet';
import icon from 'leaflet/dist/images/marker-icon.png';
import iconShadow from 'leaflet/dist/images/marker-shadow.png';

let DefaultIcon = L.icon({
          iconUrl: icon,
          shadowUrl: iconShadow
      });
L.Marker.prototype.options.icon = DefaultIcon;

發佈了97 篇原創文章 · 獲贊 16 · 訪問量 8萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章