Javascript 小册子JS iconUrl&;拉维尔
我用的是拉威尔 在我的刀片文件中,我有以下代码:Javascript 小册子JS iconUrl&;拉维尔,javascript,laravel,Javascript,Laravel,我用的是拉威尔 在我的刀片文件中,我有以下代码: <div id="mapid" class="h-screen w-full z-0" ></div > @push('head-scripts') <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"integrity="sha512 ... <
<div
id="mapid"
class="h-screen w-full z-0"
></div >
@push('head-scripts')
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"integrity="sha512 ... </script>
@endpush
@push('scripts')
<script>
//Making map and tiles
const mymap = L.map('mapid').setView([0, 0], 3);
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
maxZoom: 18,
id: 'mapbox/streets-v11',
tileSize: 512,
zoomOffset: -1,
accessToken: 'pkkagdgfsecretblablabdfgkjfdökhdfjgfag'
}).addTo(mymap);
// making a marker with an icon
const myIcon = L.icon({
iconUrl: 'http://leafletjs.com/examples/custom-icons/leaf-green.png',
iconSize: [50, 32], // size of the icon
iconAnchor: [22, 16], // point of the icon which will correspond to marker's location
});
const marker = L.marker([0, 0, {icon: myIcon}]).addTo(mymap);
marker.setLatLng([50, 20]);
</script >
@endpush
如何在laravel刀片组件内的标记内引用*.png或任何其他格式
iconUrl: 'http://somelink/some.png',
iconUrl: 'https://somelink/some.png',
iconUrl: './images/some.png',
iconUrl: '/images/some.png',
iconUrl: '/svg/some.png',
iconUrl: './svg/some.png',
iconUrl: {{ asset('/images/some.png') }},
iconUrl: {{ asset('./images/some.png') }},
iconUrl: {{ asset('./svg/some.png') }},
iconUrl: url{{ asset('/images/some.png') }},
iconUrl: '../../public/some.png',