A
A
arseniylebedev2019-07-02 20:44:05
OpenStreetMap
arseniylebedev, 2019-07-02 20:44:05

Why is the leaflet map crooked?

Why is the leaflet map so crooked?
5d1b977b9b266590325348.png
Vue component code

<template>
    <div id="map">
        <div id="leaflet-map" class="leaflet-map"></div>
    </div>
</template>

<script>
    export default {
        name: "MapComponent",

        created() {
            window._map = this;
        },

        mounted() {
            let map = L.map('leaflet-map');

            var osmUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
            var osmAttrib='';

            var osm = new L.TileLayer(osmUrl, {minZoom: 8, maxZoom: 12, attribution: osmAttrib})

            map.setView(new L.LatLng(51.3, 0.7),9);
            map.addLayer(osm);
        },

    }
</script>

<style scoped>
    
</style>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2019-07-02
@arseniylebedev

You didn't include the css from the leaflet. And set the OSM attribution as expected.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question