File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
findthatpostcode/templates Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change 6262 files</button >
6363 </div >
6464 <div class =" w-100 w-60-l pl3 fl" >
65- <l-map ref =" resultMap" style =" height : 500px ; width : 100% " :bounds =" bounds"
66- :style = " { opacity: result.features.length ? 1 : 0 } " >
65+ <l-map v-if = " result.features.length " ref =" resultMap" style =" height : 500px ; width : 100% " :bounds =" bounds"
66+ @ready = " loadMapTiles " >
6767 <l-geo-json :geojson =" result" ></l-geo-json >
6868 </l-map >
6969 </div >
144144 clearFiles () {
145145 this .files = [];
146146 },
147- },
148- mounted () {
149- this .$nextTick (() => {
147+ loadMapTiles () {
150148 L .maplibreGL ({
151149 style: ' https://tiles.openfreemap.org/styles/positron' ,
152150 attribution: `
153151 <a href="https://openfreemap.org" target="_blank">OpenFreeMap</a>
154152 <a href="https://www.openmaptiles.org/" target="_blank">© OpenMapTiles</a>
155153 Data from <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>` ,
156154 }).addTo (this .$refs .resultMap .mapObject );
157- });
155+ },
158156 },
159157 });
160158 </script >
Original file line number Diff line number Diff line change 6464 </template >
6565 </div >
6666 <div class =" w-100 w-60-l pl3 fl" >
67- <l-map ref =" resultMap" style =" height : 500px ; width : 100% " :bounds =" bounds"
68- :style = " { opacity: result.features.length ? 1 : 0 } " >
67+ <l-map v-if = " result.features.length " ref =" resultMap" style =" height : 500px ; width : 100% " :bounds =" bounds"
68+ @ready = " loadMapTiles " >
6969 <l-geo-json :geojson =" result" ></l-geo-json >
7070 </l-map >
7171 </div >
201201 link .click ();
202202 URL .revokeObjectURL (link .href );
203203 },
204- },
205- mounted () {
206- this .$nextTick (() => {
204+ loadMapTiles () {
207205 L .maplibreGL ({
208206 style: ' https://tiles.openfreemap.org/styles/positron' ,
209207 attribution: `
210208 <a href="https://openfreemap.org" target="_blank">OpenFreeMap</a>
211209 <a href="https://www.openmaptiles.org/" target="_blank">© OpenMapTiles</a>
212210 Data from <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>` ,
213211 }).addTo (this .$refs .resultMap .mapObject );
214- });
212+ },
215213 },
216214 });
217215 </script >
You can’t perform that action at this time.
0 commit comments