|
|
(174 intermediate revisions not shown) |
Line 1: |
Line 1: |
| <html> | | <html> |
- | <title>Fragoria Map</title>
| |
- | <link rel="stylesheet" href="/maps/documentation/javascript/examples/default.css" />
| |
| <link rel="stylesheet" href="/maptiles/noimageshadow.css"> | | <link rel="stylesheet" href="/maptiles/noimageshadow.css"> |
- | <script src="/maptiles/js?v=3.exp&sensor=false"></script>
| |
| | | |
- | <script> | + | <script type="text/javascript" src="/maptiles/js?v=3.exp&sensor=false"></script> |
- | var moonTypeOptions = {
| + | <script type="text/javascript" src="/mapdata/markerwithlabel.js"></script> |
- | getTileUrl: function(coord, zoom) {
| + | <script type="text/javascript" src="/wiki/skins/common/fmap.js"></script> |
- | var normalizedCoord = getNormalizedCoord(coord, zoom);
| + | |
- | if (!normalizedCoord) {
| + | |
- | return null;
| + | |
- | }
| + | |
- | var bound = Math.pow(2, zoom);
| + | |
- | return '/maptiles/' + zoom + '/' + normalizedCoord.y + '_' + normalizedCoord.x + '.jpg';
| + | |
- | },
| + | |
- | tileSize: new google.maps.Size(256, 256),
| + | |
- | maxZoom: 3,
| + | |
- | minZoom: 1,
| + | |
- | radius: 1738000,
| + | |
- | name: 'Fragoria'
| + | |
- | };
| + | |
| | | |
- | var moonMapType = new google.maps.ImageMapType(moonTypeOptions);
| + | <style> |
- | | + | .maplabels { |
- | function initialize() {
| + | color: #000; |
- | var Fragotown = new google.maps.LatLng(-89.623848,33.001326);
| + | // font-family: 'Comic Sans MS', cursive, sans-serif; |
- | var mapOptions = {
| + | line-height: 1em; |
- | center: Fragotown,
| + | font-size: 13px; |
- | zoom: 4,
| + | text-shadow: 0px 0px 2px white; |
- | streetViewControl: false,
| + | font-weight: bold; |
- | mapTypeControlOptions: {
| + | border: 0px solid black; |
- | mapTypeIds: ['moon']
| + | background: transparent url('/wiki/images/e/eb/Backgroundgradient.png'); |
- | }
| + | background-size: 100% 100%; |
- | };
| + | background: radial-gradient(white, rgba(255, 255, 255, .6), rgba(255, 255, 255, .0), rgba(255, 255, 255, 0)); |
- | var map = new google.maps.Map(document.getElementById('map_canvas'),
| + | } |
- | mapOptions);
| + | </style> |
- | map.mapTypes.set('moon', moonMapType);
| + | |
- | map.setMapTypeId('moon');
| + | |
- | | + | |
- | // Bounds
| + | |
- | var strictBounds = new google.maps.LatLngBounds(
| + | |
- | new google.maps.LatLng(-89.957,-65),
| + | |
- | new google.maps.LatLng(65,65)
| + | |
- | );
| + | |
- | // Listen for the CENTER_CHANGED event
| + | |
- | google.maps.event.addListener(map, 'center_changed', function() {
| + | |
- | if (strictBounds.contains(map.getCenter())) return;
| + | |
- | // We're out of bounds - Move the map back within the bounds
| + | |
- | var c = map.getCenter(),
| + | |
- | x = c.lng(),
| + | |
- | y = c.lat(),
| + | |
- | maxX = strictBounds.getNorthEast().lng(),
| + | |
- | maxY = strictBounds.getNorthEast().lat(),
| + | |
- | minX = strictBounds.getSouthWest().lng(),
| + | |
- | minY = strictBounds.getSouthWest().lat();
| + | |
- | if (x < minX) x = minX;
| + | |
- | if (x > maxX) x = maxX;
| + | |
- | if (y < minY) y = minY;
| + | |
- | if (y > maxY) y = maxY;
| + | |
- | map.setCenter(new google.maps.LatLng(y, x));
| + | |
- | });
| + | |
- | // Limit the zoom level
| + | |
- | google.maps.event.addListener(map, 'zoom_changed', function() {
| + | |
- | if (map.getZoom() < minZoomLevel) map.setZoom(minZoomLevel);
| + | |
- | });
| + | |
- | | + | |
- | setMarkers (map, dungeons);
| + | |
- | | + | |
- | var FragotownMarker = new google.maps.Marker({
| + | |
- | position: new google.maps.LatLng(-89.623848,33.001326),
| + | |
- | map: map,
| + | |
- | draggable:true,
| + | |
- | optimized: false,
| + | |
- | title:"Fragotown"
| + | |
- | });
| + | |
- |
| + | |
- | //Report Coordinates
| + | |
- | google.maps.event.addListener(FragotownMarker, 'dragend', function(evt){
| + | |
- | document.getElementById('current').innerHTML = '(' + evt.latLng.lat().toFixed(6) + ',' + evt.latLng.lng().toFixed(6) + ')</p>';
| + | |
- | });
| + | |
- | google.maps.event.addListener(FragotownMarker, 'dragstart', function(evt){
| + | |
- | document.getElementById('current').innerHTML = '<p>Locating...</p>';
| + | |
- | });
| + | |
- | }
| + | |
- | | + | |
- | // Normalizes the coords that tiles repeat across the x axis (horizontally)
| + | |
- | // like the standard Google map tiles.
| + | |
- | function getNormalizedCoord(coord, zoom) {
| + | |
- | var y = coord.y;
| + | |
- | var x = coord.x;
| + | |
- | // tile range in one direction range is dependent on zoom level
| + | |
- | // 0 = 1 tile, 1 = 2 tiles, 2 = 4 tiles, 3 = 8 tiles, etc
| + | |
- | var tileRange = 2 << zoom;
| + | |
- | // repeat across y-axis (vertically)
| + | |
- | if (y < 0 || y >= tileRange) {
| + | |
- | // y = (y % tileRange + tileRange) % tileRange;
| + | |
- | return null;
| + | |
- | }
| + | |
- | // repeat across x-axis
| + | |
- | if (x < 0 || x >= tileRange) {
| + | |
- | x = (x % tileRange + tileRange) % tileRange;
| + | |
- | // return null;
| + | |
- | }
| + | |
- | return {
| + | |
- | x: x,
| + | |
- | y: y
| + | |
- | };
| + | |
- | | + | |
- | }
| + | |
- |
| + | |
- | var dungeons = [
| + | |
- | ['Dark Konungs Tomb',-89.128166,16.829451,2],
| + | |
- | ['Robbers Vault',-89.089905,47.766951,3],
| + | |
- | ['Savage Dens',-89.221718,29.309920,4],
| + | |
- | ['Wolfs Lair',-89.931470,45.657576,5],
| + | |
- | ['Castle Pantry',-89.870076,-49.527971,6],
| + | |
- | ['Poisoned Spring',-89.848769,-88.551408,7],
| + | |
- | ['Robbers Camp',-88.900931,-51.901018,8],
| + | |
- | ['Underwater Temple Grandmothers Cave',-87.884290,-87.760393,9],
| + | |
- | ['Yard of the Red Witch',-82.335838,-100.152971,10],
| + | |
- | ['Abandoned Bonekeep',-62.927026,-64.293596,11],
| + | |
- | ['White Worms Lair',24.423564,-113.072893,12],
| + | |
- | ['Winter Castle',32.450837,-79.059221,13],
| + | |
- | ['Gates of Night',65.319363,-104.108049,14],
| + | |
- | ['Prison of the Ancient Gods',67.329878,-103.844377,15]
| + | |
- | ];
| + | |
- |
| + | |
- | function setMarkers(map, locations) {
| + | |
- | var dungeonimage = {
| + | |
- | url: '/wiki/images/f/f7/Greendungeonicon.png',
| + | |
- | size: new google.maps.Size(40, 40),
| + | |
- | origin: new google.maps.Point(0, 0),
| + | |
- | anchor: new google.maps.Point(20, 20)
| + | |
- | };
| + | |
- | var shape = {
| + | |
- | coords: [0, 0, 0, 40, 40, 40 , 40, 0],
| + | |
- | type: 'poly'
| + | |
- | };
| + | |
- | for (var i = 0; i < locations.length; i++) {
| + | |
- | var dungeon = locations[i];
| + | |
- | | + | |
- | var marker = new google.maps.Marker({
| + | |
- | position: new google.maps.LatLng(dungeon[1], dungeon[2]);,
| + | |
- | map: map,
| + | |
- | icon: dungeonimage,
| + | |
- | shape: shape,
| + | |
- | title: dungeon[0],
| + | |
- | zIndex: dungeon[3]
| + | |
- | });
| + | |
- | }
| + | |
- | | + | |
- | var contentString = '<div id="content">'+
| + | |
- | '<div id="siteNotice">'+
| + | |
- | '</div>'+
| + | |
- | '<h1 id="firstHeading" class="firstHeading">Uluru</h1>'+
| + | |
- | '<div id="bodyContent">'+
| + | |
- | '<p><b>Uluru</b>, also referred to as <b>Ayers Rock</b>, is a large ' +
| + | |
- | 'sandstone rock formation in the southern part of the '+
| + | |
- | 'Northern Territory, central Australia. It lies 335 km (208 mi) '+
| + | |
- | 'south west of the nearest large town, Alice Springs; 450 km '+
| + | |
- | '(280 mi) by road. Kata Tjuta and Uluru are the two major '+
| + | |
- | 'features of the Uluru - Kata Tjuta National Park. Uluru is '+
| + | |
- | 'sacred to the Pitjantjatjara and Yankunytjatjara, the '+
| + | |
- | 'Aboriginal people of the area. It has many springs, waterholes, '+
| + | |
- | 'rock caves and ancient paintings. Uluru is listed as a World '+
| + | |
- | 'Heritage Site.</p>'+
| + | |
- | '<p>Attribution: Uluru, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
| + | |
- | 'https://en.wikipedia.org/w/index.php?title=Uluru</a> '+
| + | |
- | '(last visited June 22, 2009).</p>'+
| + | |
- | '</div>'+
| + | |
- | '</div>';
| + | |
- | | + | |
- | var infowindow = new google.maps.InfoWindow({
| + | |
- | content: contentString
| + | |
- | });
| + | |
- | | + | |
- | google.maps.event.addListener(marker, 'click', function() {
| + | |
- | infowindow.open(map,marker);
| + | |
- | });
| + | |
- | | + | |
- | }
| + | |
- | | + | |
- | google.maps.event.addDomListener(window, 'load', initialize);
| + | |
| | | |
| + | <script> |
| + | $('.map_canvas').css('width', '100%').css('width', '+=1px'); |
| </script> | | </script> |
- |
| |
- | <body>
| |
| <center> | | <center> |
- | <div id="current"> </div> | + | <div> |
- | <div style="box-shadow: 2px 2px 5px #999999;border: 1px solid black;width: 97%; height: 610px;background-image:url('/wiki/images/1/1f/Background.jpg');" id="map_canvas">
| + | <div style="border:33px solid transparent;border-image: url(/wiki/images/d/d9/Mapborder.png) 36 round;z-index:9999999999;"> |
- | </div>
| + | <div style="border:1px solid black;border-radius: 18px;border: width: 100%; height: 530px;background-image:url('/wiki/images/1/1f/Background.jpg');margin: -23px -24px -24px -24px;" id="map_canvas"> |
| + | </div></div> |
| + | <div id="current"> </div> |
| + | <input type="button" value="Show All" onclick="showallMarkers();showallPolylines(999);"> |
| + | <input type="button" value="Road Stones" onclick="displayMarkers(100);showallPolylines(999);"> |
| + | <input type="button" value="Green Dungeons" onclick="displayMarkers(10);hideallPolylines();"> |
| + | <input type="button" value="Red Dungeons" onclick="displayMarkers(20);hideallPolylines();"> |
| + | <input type="button" value="Hide All" onclick="hideallMarkers();hideallPolylines();"> |
| </center> | | </center> |
- | </body>
| + | |
| </html> | | </html> |