6464 </template >
6565 </div >
6666 <div class =" w-100 w-60-l pl3 fl" >
67- <l-map v-if =" result.features.length" style =" height : 500px ; width : 100% " :bounds =" bounds" >
67+ <l-map ref =" resultMap" style =" height : 500px ; width : 100% " :bounds =" bounds"
68+ :style =" { opacity: result.features.length ? 1 : 0 }" >
6869 <l-geo-json :geojson =" result" ></l-geo-json >
69- <l-tile-layer url =" https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}{r}.png"
70- :attribution =" attribution" />
7170 </l-map >
7271 </div >
7372</div >
7473{% endblock %}
7574
7675{% block headscripts %}
7776<link rel =" stylesheet" href =" {{ url_for('static', filename='lib/leaflet/leaflet.css' )}}" />
77+ <link rel =" stylesheet" href =" {{ url_for('static', filename='lib/maplibre/maplibre-gl.css' )}}" />
7878{% endblock %}
7979
8080{% block bodyscripts %}
8181<script src =" https://cdn.jsdelivr.net/npm/vue@2" ></script >
8282<script src =" {{ url_for('static', filename='lib/leaflet/leaflet.js' )}}" ></script >
83+ <script src =" {{ url_for('static', filename='lib/maplibre/maplibre-gl.js' )}}" ></script >
84+ <script type =" text/javascript" src =" {{ url_for('static', filename='lib/maplibre/leaflet-maplibre-gl.js') }}" ></script >
8385<script src =" //unpkg.com/vue2-leaflet" ></script >
8486<script >
8587 // recursively round all coordinates in a javascript array
110112 filename: ' mergedfile' ,
111113 enableTooltip: true ,
112114 bounds: [[- 90 , - 180 ], [90 , 180 ]],
113- attribution:
114- ' © <a href="https://stadiamaps.com/" target="_blank">Stadia Maps</a> <a href="https://www.stamen.com/" target="_blank">© Stamen Design</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> © <a href="https://www.openstreetmap.org/about" target="_blank">OpenStreetMap</a> contributors' ,
115115 },
116116 watch: {
117117 ' file ' : function () {
201201 link .click ();
202202 URL .revokeObjectURL (link .href );
203203 },
204- }
204+ },
205+ mounted () {
206+ this .$nextTick (() => {
207+ L .maplibreGL ({
208+ style: ' https://tiles.openfreemap.org/styles/positron' ,
209+ attribution: `
210+ <a href="https://openfreemap.org" target="_blank">OpenFreeMap</a>
211+ <a href="https://www.openmaptiles.org/" target="_blank">© OpenMapTiles</a>
212+ Data from <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>` ,
213+ }).addTo (this .$refs .resultMap .mapObject );
214+ });
215+ },
205216 });
206217 </script >
207218{% endblock %}
0 commit comments