Hi! The map is displayed correctly only if I open the code inspector. Why? If I don't open the inspector it only loads one image, without centering and the others are grayed out. asked 07 Jun '21, 11:45 Lilu44 |
NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum
Hi! The map is displayed correctly only if I open the code inspector. Why? If I don't open the inspector it only loads one image, without centering and the others are grayed out. asked 07 Jun '21, 11:45 Lilu44 |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Question tags:
question asked: 07 Jun '21, 11:45
question was seen: 993 times
last updated: 07 Jun '21, 14:17
NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum
Can you explain a bit more about where you see this problem? What sort of machine are you using? Which operating system is it using? Which web browser? Which version?
When I load the map it doesn't center it inside the div, just an image appears. Then I open the inspector and load the other images and center the map inside the div. I use an Ubuntu 20 operating system, and I see the map from the Mozilla Firefox 1.0 browser. Thanks for your reply.
Just to confirm - you're just browsing to "https://www.openstreetmap.org" , you're not trying to do anything "clever" like trying to embed https://www.openstreetmap.org as part of a different website?
There is no "Ubuntu 20", but presumably your are using "Ubuntu 20.04" or "Ubuntu 20.10".
Are you really using verion 1.0 of Firefox? This seems unlikely.
Ok I think I have not explained myself well. I am using Leaflet and I access openstreetmap. This is the code: var map = L.map ( "map", { center: [markers [0] [1], markers [0] [2]], zoom: 10, zoomControl: true, preferCanvas: false, } );
var tile_layer = L.tileLayer ( "https: // {s} .tile.openstreetmap.org / {z} / {x} / {y} .png", {"attribution": "Data by \ u0026copy; \ u003ca href = \" http: //openstreetmap.org \ "\ u003eOpenStreetMap \ u003c / a \ u003e, under \ u003ca href = \" http: //www.openstreetmap. org / copyright \ "\ u003eODbL \ u003c / a \ u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false} ) .addTo (mapper);
And I think the problem is in openstreetmap.org.
If you want to compare your code with some that works have a look at https://github.com/SomeoneElseOSM/mod_tile/blob/switch2osm/extra/sample_leaflet.html .