Пытаюсь запустить сервер Python в пограничном браузере, чтобы запустить html-файл на моем жестком диске, но он не показыHtml

Программисты Html
Ответить
Anonymous
 Пытаюсь запустить сервер Python в пограничном браузере, чтобы запустить html-файл на моем жестком диске, но он не показы

Сообщение Anonymous »

оба файла находятся на жестком диске в одной папке map.html и Radar_20251120_202150_1.png
[
Изображение

и код map.html

Код: Выделить всё



OpenStreetMap Image Overlay






#map { height: 600px; width: 100%; }





// Initialize the map centered on the USA
var map = L.map('map').setView([39.8283, -98.5795], 5);

// Add the OpenStreetMap base layer
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© [url=www.openstreetmap.org]OpenStreetMap[/url] contributors'
}).addTo(map);

// --- Image Overlay Configuration ---
// IMPORTANT: The image must be in the same folder as this HTML file for this path to work
var imageUrl = 'Radar_20251120_202150_1.png';

// Define the geographic bounds of the image (latitude and longitude)
// You MUST replace these placeholder coordinates with the actual bounds for your specific radar image.
var southWest = L.latLng(25.5, -125.0); // Example: Bottom-left corner (Lat, Lng)
var northEast = L.latLng(50.0, -60.0);  // Example: Top-right corner (Lat, Lng)
var imageBounds = L.latLngBounds(southWest, northEast);

// Add the image overlay to the map
L.imageOverlay(imageUrl, imageBounds, {
opacity: 0.8,
alt: 'Weather radar overlay'
}).addTo(map);

// Optional: Zoom the map to fit the bounds of the radar image
map.fitBounds(imageBounds);




я запускаю его через cmd от имени администратора.

Код: Выделить всё

D:\>python -m http.server 8000
Serving HTTP on :: port 8000 (http://[::]:8000/) ...
::1 - - [23/Nov/2025 18:05:14] "GET /map.html HTTP/1.1" 200 -
::1 - - [23/Nov/2025 18:05:14] code 404, message File not found
::1 - - [23/Nov/2025 18:05:14] "GET /unpkg.com HTTP/1.1" 404 -
::1 - - [23/Nov/2025 18:05:14] code 404, message File not found
::1 - - [23/Nov/2025 18:05:14] "GET /unpkg.com HTTP/1.1" 404 -
и когда я просматриваю его, я получаю белую страницу. и в окне консоли cmd я получаю ошибки.
Изображение


Подробнее здесь: https://stackoverflow.com/questions/798 ... -hard-disk
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Html»