Skip to content

Commit

Permalink
Debug: gitlab pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianP committed Oct 31, 2023
1 parent 4e84d36 commit 262df86
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 16 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Laravel GeoJson Myanmar

## Start in php server
```
sudo php -S localhost:8080 ./prototype-test/townships.html
```

## API
### Country
```
Expand Down
17 changes: 17 additions & 0 deletions prototype-test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index</title>
</head>
<body>
<ul>
<li><a href="./country.html">country.html</a></li>
<li><a href="./districts.html">districts.html</a></li>
<li><a href="./myanmar-cities.html">myanmar-cities.html</a></li>
<li><a href="./state-regions.html">state-regions.html</a></li>
<li><a href="./townships.html">townships.html</a></li>
</ul>
</body>
</html>
37 changes: 21 additions & 16 deletions prototype-test/townships.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA=="
crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-QVftwZFqvtRNi0ZyCtsznlKSWOStnDORoefr1enyq5mVL4tmKB3S/EnC3rRJcxCPavG10IcrVGSmPh6Qw5lwrg=="
crossorigin=""></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" ></script>

<style>
#mmGeoJsonMap {
Expand All @@ -20,19 +16,28 @@
<div id="mmGeoJsonMap"></div>
<script>
async function buildMap(url) {
let response = await fetch(url);
const json = await response.json();
const geoJson = json;
var mapStyle = {
let response = await fetch(url);
const json = await response.json();
const geoJson = json;
var mapStyle = {
fillColor:"#fff",
color:"#000",
weight:'1',
fillOpacity:1
};
var mapCenter = [21.23750038304331, 95.80412357008937];
var zoom = 5;
var basicMap = L.map('mmGeoJsonMap').setView(mapCenter,zoom);
var jsonLayer = L.geoJSON(geoJson,{style:mapStyle}).addTo(basicMap);
fillOpacity: 0.75
};
var mapCenter = [21.23750038304331, 95.80412357008937];
var mapZoom = 5;
var basicMap = new L.Map('mmGeoJsonMap', {
layers: L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'),
center: L.latLng(mapCenter),
zoom: mapZoom,
minZoom: 17,
maxZoom: 25
});
var jsonLayer = L.geoJSON(geoJson,{style:mapStyle}).addTo(basicMap);
//var jsonLayer = L.geoJSON(geoJson).addTo(basicMap);
//var map = L.map('mmGeoJsonMap').setView([51.505, -0.09], 13);

}
var url = 'https://raw.githubusercontent.com/laravel-stack/laravel-geo-json-myanmar/main/dist/geojson/townships.geojson';
buildMap(url);
Expand Down

0 comments on commit 262df86

Please sign in to comment.