Template:Fragoria Map

From FragoriaWiki

(Difference between revisions)
Jump to: navigation, search
Line 40: Line 40:
map.setMapTypeId('moon');
map.setMapTypeId('moon');
-
  // Bounds
 
-
  var strictBounds = new google.maps.LatLngBounds(
 
-
new google.maps.LatLng(-90, 80),
 
-
new google.maps.LatLng(90, -89.999)
 
-
  );
 
-
 
-
  // 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);
 
-
  });
 
-
 
var marker = new google.maps.Marker({
var marker = new google.maps.Marker({
position: new google.maps.LatLng(-89.62,33.4),
position: new google.maps.LatLng(-89.62,33.4),

Revision as of 03:26, 5 April 2015

Fragoria Map

Personal tools
Date/Time
Server & Cross

Super-Cross Server