dev-resources.site
for different kinds of informations.
GIS MAP Leaflet JS with OPENSTREETMAP SAMPLE
Published at
1/26/2024
Categories
Author
Teddy Zugana
Categories
1 categories in total
open
<!DOCTYPE html>
<html lang="en">
<head>
<base target="_top">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Quick Start - Leaflet</title>
<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
<style>
html, body {
height: 100%;
margin: 0;
}
.leaflet-container {
height: 400px;
width: 600px;
max-width: 100%;
max-height: 100%;
}
</style>
</head>
<body>
<div id="map" style="width: 600px; height: 400px;"></div>
<script>
const map = L.map('map').setView([51.505, -0.09], 13);
const tiles = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
const marker = L.marker([51.5, -0.09]).addTo(map)
.bindPopup('<b>Hello world!</b><br />I am a popup.').openPopup();
const circle = L.circle([51.508, -0.11], {
color: 'red',
fillColor: '#f03',
fillOpacity: 0.5,
radius: 500
}).addTo(map).bindPopup('I am a circle.');
const polygon = L.polygon([
[51.509, -0.08],
[51.503, -0.06],
[51.51, -0.047]
]).addTo(map).bindPopup('I am a polygon.');
const popup = L.popup()
.setLatLng([51.513, -0.09])
.setContent('I am a standalone popup.')
.openOn(map);
function onMapClick(e) {
popup
.setLatLng(e.latlng)
.setContent(`You clicked the map at ${e.latlng.toString()}`)
.openOn(map);
}
map.on('click', onMapClick);
</script>
</body>
</html>
Articles
12 articles in total
Obfuscating “Hello world!” obfuscate on Python
read article
Secure Nginx with Let's Encrypt on Ubuntu
read article
Auto Deploy Laravel with Deployer.yml sample With Github Runner
read article
Managing Docker Containers with Portainer
read article
Nginx force http to https On 443 https Port
read article
Java FTPS disabling Certificate Check , FOR FIX FTP SSL certificate expired exception
read article
GIS MAP Leaflet JS with OPENSTREETMAP SAMPLE
currently reading
GIS MAP Leaflet JS with API MAPBOX SAMPLE
read article
Jaro and Jaro-Winkler distance, measuring similarity between strings on PHP.
read article
Python Scraping web page with BeautifulSoup and requests Example
read article
PHP Mimic Excel Rate Function
read article
How To Install unixODBC-devel on CentOS 7 and Connect DB2 V9.7
read article
Featured ones: