Skip to content

Commit

Permalink
Merge pull request #17 from HackerspaceKRK/map_fix
Browse files Browse the repository at this point in the history
try to fix map
  • Loading branch information
hbrylkowski authored Aug 13, 2023
2 parents 2062a25 + a7dc652 commit 31f1fef
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 2 additions & 0 deletions _includes/custom-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
2. Customize default _includes/custom-head.html in your source directory and insert the given code snippet.
{% endcomment %}
<link rel="Shortcut icon" href="{{'/favicon.png' | relative_url }}" />
<link href="https://api.mapbox.com/mapbox-gl-js/v2.15.0/mapbox-gl.css" rel="stylesheet">
<script src="https://api.mapbox.com/mapbox-gl-js/v2.15.0/mapbox-gl.js"></script>
30 changes: 15 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ <h2>
<h2>
Jak nas znaleźć?
</h2>
<div id="mapmain">
<script>
var mymap = L.map('mapmain').setView([50.06603, 19.94336], 15);
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1Ijoid3ByenliIiwiYSI6IjRnckNtYncifQ.3q8gdJY61IsaClOZDa200w', {
maxZoom: 15,
attribution: 'Map data &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="https://mapbox.com">Mapbox</a>',
id: 'mapbox/streets-v11'
}).addTo(mymap);

L.marker([50.06603, 19.94336]).addTo(mymap)
.bindPopup('<a href="https://phabricator.hskrk.pl/w/about/siedziba"><strong>Hackerspace Kraków</strong></a>');
</script>
</div>
<div id="map"></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1Ijoid3ByenliIiwiYSI6IjRnckNtYncifQ.3q8gdJY61IsaClOZDa200w';
const map = new mapboxgl.Map({
container: 'map', // container ID
// Choose from Mapbox's core styles, or make your own style with Mapbox Studio
style: 'mapbox://styles/mapbox/streets-v12', // style URL
center: [50.06603, 19.94336], // starting position [lng, lat]
zoom: 15 // starting zoom
});
const hs = new mapboxgl.Marker()
.setLngLat([50.06603, 19.94336])
.bindPopup('<a href="https://phabricator.hskrk.pl/w/about/siedziba"><strong>Hackerspace Kraków</strong></a>')
.addTo(map);
</script>

0 comments on commit 31f1fef

Please sign in to comment.