Created
August 23, 2020 00:17
-
-
Save DeaVenditama/d77bed7c6ad6acc99a893bacf5fca6ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?= $this->extend('layout') ?> | |
<?= $this->section('head') ?> | |
<script src="<?= base_url('leaflet/leaflet.js') ?>"></script> | |
<link rel="stylesheet" href="<?= base_url('leaflet/leaflet.css') ?>" /> | |
<style> | |
#maps { | |
height: 500px; | |
} | |
</style> | |
<?= $this->endSection() ?> | |
<?= $this->section('content') ?> | |
<h1>Peta Indonesia</h1> | |
<div id="maps"></div> | |
<?= $this->endSection() ?> | |
<?= $this->section('script') ?> | |
<script> | |
var map = L.map('maps').setView({ lat : 0.7893, lon : 113.9213 }, 5); | |
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { | |
maxZoom: 19, | |
attribution: '© <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>' | |
}).addTo(map); | |
L.marker({lat : 0.7893, lon : 113.9213}).bindPopup('Hello Indonesia').addTo(map); | |
</script> | |
<?= $this->endSection() ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment