Skip to content

Instantly share code, notes, and snippets.

@kumy
Created February 4, 2019 20:46
Show Gist options
  • Save kumy/2da4fb6c8b0e619e355d4e752a9b1c72 to your computer and use it in GitHub Desktop.
Save kumy/2da4fb6c8b0e619e355d4e752a9b1c72 to your computer and use it in GitHub Desktop.
gk6690.map
<script type="text/javascript">
function load() {
if (GBrowserIsCompatible()) {
var icon = new GIcon();
icon.image = "templates/icons/yellow.png";
icon.shadow = "templates/icons/shadow.png";
icon.iconSize = new GSize(12, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);
var icon2 = new GIcon();
icon2.image = "templates/icons/red.png";
icon2.shadow = "templates/icons/shadow.png";
icon2.iconSize = new GSize(12, 20);
icon2.shadowSize = new GSize(22, 20);
icon2.iconAnchor = new GPoint(6, 20);
icon2.infoWindowAnchor = new GPoint(5, 1);
var icon3 = new GIcon();
icon3.image = "templates/icons/green.png";
icon3.shadow = "templates/icons/shadow.png";
icon3.iconSize = new GSize(12, 20);
icon3.shadowSize = new GSize(22, 20);
icon3.iconAnchor = new GPoint(6, 20);
icon3.infoWindowAnchor = new GPoint(5, 1);
var map0 = new GMap2(document.getElementById("map0"));
map0.addControl(new GSmallMapControl());
map0.addControl(new GMapTypeControl());
map0.setCenter(new GLatLng(43.10150,-88.28948), 6);
obszar = new GLatLngBounds();
var trasa = new GPolyline([new GLatLng(43.10150,-88.28948),
new GLatLng(43.05797,-88.05373),
new GLatLng(43.05797,-88.05373),
new GLatLng(35.70210,139.77835),
new GLatLng(51.02720,13.76465),
new GLatLng(52.42368,13.03637),
new GLatLng(52.31002,10.81525),
], "#004080", 5);
map0.addOverlay(trasa);
var punkt = new GLatLng(43.10150,-88.28948);
var marker1 = new GMarker(punkt, icon3);
map0.addOverlay(marker1);
GEvent.addListener(marker1, "click", function() {marker1.openInfoWindowHtml('Hidden: 2017-10-11 12:00:00<br />in <a href="http://www.geocaching.com/seek/cache_details.aspx?wp=GC6QRCR" target="_blank">GC6QRCR</a><br />');});
obszar.extend(punkt);
var punkt = new GLatLng(43.05797,-88.05373);
var marker2 = new GMarker(punkt, icon);
map0.addOverlay(marker2);
GEvent.addListener(marker2, "click", function() {marker2.openInfoWindowHtml('Hidden: 2017-10-03 12:00:00<br />in 43.05797/-88.05373<br />');});
obszar.extend(punkt);
var punkt = new GLatLng(43.05797,-88.05373);
var marker3 = new GMarker(punkt, icon);
map0.addOverlay(marker3);
GEvent.addListener(marker3, "click", function() {marker3.openInfoWindowHtml('Hidden: 2017-10-03 11:55:00<br />in 43.05797/-88.05373<br />');});
obszar.extend(punkt);
var punkt = new GLatLng(35.70210,139.77835);
var marker4 = new GMarker(punkt, icon);
map0.addOverlay(marker4);
GEvent.addListener(marker4, "click", function() {marker4.openInfoWindowHtml('Hidden: 2013-02-09 19:00:00<br />in <a href="http://www.geocaching.com/seek/cache_details.aspx?wp=GC44Q3M" target="_blank">GC44Q3M</a><br />');});
obszar.extend(punkt);
var punkt = new GLatLng(51.02720,13.76465);
var marker5 = new GMarker(punkt, icon);
map0.addOverlay(marker5);
GEvent.addListener(marker5, "click", function() {marker5.openInfoWindowHtml('Hidden: 2013-01-06 14:30:00<br />in <a href="http://www.geocaching.com/seek/cache_details.aspx?wp=GC3F4BP" target="_blank">GC3F4BP</a><br />');});
obszar.extend(punkt);
var punkt = new GLatLng(52.42368,13.03637);
var marker6 = new GMarker(punkt, icon);
map0.addOverlay(marker6);
GEvent.addListener(marker6, "click", function() {marker6.openInfoWindowHtml('Hidden: 2012-11-18 17:37:00<br />in 52.42368/13.03637<br />');});
obszar.extend(punkt);
var punkt = new GLatLng(52.31002,10.81525);
var marker7 = new GMarker(punkt, icon2);
map0.addOverlay(marker7);
GEvent.addListener(marker7, "click", function() {marker7.openInfoWindowHtml('Hidden: 2012-09-25 12:00:00<br />in <a href="http://www.geocaching.com/seek/cache_details.aspx?wp=GC375D6" target="_blank">GC375D6</a><br />');});
obszar.extend(punkt);
var nowyZoom = map0.getBoundsZoomLevel(obszar);
var nowyPunkt = obszar.getCenter();
map0.setCenter(nowyPunkt,nowyZoom-1);
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment