Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
guomaimang committed Nov 21, 2022
1 parent acd86cd commit 494c369
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ build/

### VS Code ###
.vscode/
.DS_Store
16 changes: 13 additions & 3 deletions src/main/java/comp4342/group15/gemserver/model/MapBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public final class MapBox {
<meta charset="utf-8">
<title>Add custom icons with Markers</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<link href="https://api.mapbox.com/mapbox-gl-js/v2.10.0/mapbox-gl.css" rel="stylesheet">
<script src="https://api.mapbox.com/mapbox-gl-js/v2.10.0/mapbox-gl.js"></script>
<link href="https://api.mapbox.com/mapbox-gl-js/v2.11.0/mapbox-gl.css" rel="stylesheet">
<script src="https://api.mapbox.com/mapbox-gl-js/v2.11.0/mapbox-gl.js"></script>
<style>
body { margin: 0; padding: 0; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
Expand All @@ -35,6 +35,16 @@ public final class MapBox {
<div id="map"></div>
\s
<script>
(function(){
window.alert = function(name){
var iframe = document.createElement("IFRAME");
iframe.style.display="none";
iframe.setAttribute("src", 'data:text/plain');
document.documentElement.appendChild(iframe);
window.frames[0].window.alert(name);
iframe.parentNode.removeChild(iframe);
}
})();
mapboxgl.accessToken = 'pk.eyJ1IjoiaGFuamlhbWluZyIsImEiOiJjbDYzZ29hZWIwY2l5M29uam5taTc0MjJqIn0.tcjuacfyZfjsHR3B3aIQyA';
const geojson = {
'type': 'FeatureCollection',
Expand Down Expand Up @@ -237,7 +247,7 @@ public final class MapBox {
const map = new mapboxgl.Map({
container: 'map',
// Choose from Mapbox's core styles, or make your own style with Mapbox Studio
style: 'mapbox://styles/mapbox/streets-v11',
style: 'mapbox://styles/mapbox/streets-v12',
center: [~UX, ~UY],
zoom: 15
});
Expand Down

0 comments on commit 494c369

Please sign in to comment.