I have a major issue here that I have been totally unable to
overcome.  I am using a custom world map overlay, but when the user
scrolls left or right of the map, it goes back to the default Google
map images.  I need it to continue repeating my custom tiles to the
left and right.  I don't even have any zoom issues, because the client
wants the entire world to be visible at all times.  I have to have
this done in the next couple of days, and I am at a total loss.  Can
someone help, please??

Here is my code below.  This is piece-meal from different examples I
have found (so it isn't the greatest code), but it pretty much works
for what I need except in this issue.

Feel free to CC responses to me at [email protected]

Thanks for any help!!!!

PS: If someone can also tell me how to make it only scroll east/west,
and not north/south, that would be an added bonus!


==============================================
var map;
var initialLocation;
var browserSupportFlag =  new Boolean();
var markersArray = [];
var pathCoordinates = [];
var poly;
var intMarkersCount = 0;
var overlay;
var infoWindow;
var contentString;
var myMarkers = [];
var lastI;
var intInfoWindowOpened = -1;
var ctrLatLng = new google.maps.LatLng(7.333693,0.660895);

var ftnMapTiles = {
  getTileUrl: function(coord, zoom) {
    return "http://www.mydomain.com/maps/"; + zoom + "/" + zoom + "_" +
coord.x + "_" + coord.y + ".png";
  },
  tileSize: new google.maps.Size(256, 256),
  isPng: true,
  minZoom: 1,
  maxZoom: 3
};

var ftnMapType = new google.maps.ImageMapType(ftnMapTiles);

function ftnInitGMaps() {
  var myOptions = {
    zoom: 2,
    draggable: true,
    center: ctrLatLng,
    mapTypeControl: false,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    navigationControl: false,
    navigationControlOptions: {
      style: google.maps.NavigationControlStyle.SMALL
    },
    scrollwheel: false
  }

  map = new google.maps.Map(document.getElementById("ftnDivMap"),
myOptions);
  map.overlayMapTypes.insertAt(0, ftnMapType);

  pathCoordinates = new google.maps.MVCArray();

  google.maps.event.addListener(map, 'zoom_changed', function() {
    if (map.getZoom() < 2){
      map.setZoom(2);
    }
    if (map.getZoom() > 2){
      map.setZoom(2);
    }
  });

  var polyOptions = {
    path: pathCoordinates,
    strokeColor: '#CC0000',
    strokeOpacity: 1.0,
    strokeWeight: 3
  }
  poly = new google.maps.Polyline(polyOptions);
  poly.setMap(map);

  ftnShowOverlays();
  document.getElementById("ftnDivMap").style.visibility = "visible";
}


function ftnAddMarker(x_objLocation, x_strTitle, x_strHTML,
x_blnIsUser, x_strColor) {
  marker = new google.maps.Marker({
    position: x_objLocation,
    title: x_strTitle,
    clickable: true,
    visable: true,
    icon: "http://www.google.com/intl/en_us/mapfiles/ms/micons/"; +
x_strColor + "-dot.png"
  });

  markersArray.push(marker);

  myMarkers[intMarkersCount] = new Object;
  myMarkers[intMarkersCount].marker = marker;
  myMarkers[intMarkersCount].html = x_strHTML;

  myMarkers[intMarkersCount].infoWindow = new google.maps.InfoWindow({
    content: '<div style="text-align: center;width: 195px;border:
solid 0px;"><div style="">' + myMarkers[intMarkersCount].html + '</
div></div>',
    maxWidth: 150,
    pixelOffset: new google.maps.Size(0,0)
  });

  myMarkers[intMarkersCount].listener =
ftnMakeClosure(intMarkersCount, myMarkers[intMarkersCount].marker) ;

  if (x_blnIsUser) {
    intInfoWindowOpened = intMarkersCount;
  }
  intMarkersCount++;
}

function ftnMakeClosure(i, marker) {
  var listener = google.maps.event.addListener(marker, 'click',
function() {
    ftnOpenInfoWindow(i);
  });
  return listener ;
}

function ftnOpenInfoWindow(i) {
  if (typeof(lastI) == 'number' && typeof(myMarkers[lastI].infoWindow)
== 'object' ) {
    myMarkers[lastI].infoWindow.close() ;
  }
  lastI = i ;
  myMarkers[i].infoWindow.open(map, myMarkers[i].marker);
  map.setCenter(ctrLatLng);
}

function ftnShowOverlays() {
  var path = poly.getPath();

  if (markersArray) {
    for (i in markersArray) {
      if (markersArray[i].position != undefined) {
        path.insertAt(pathCoordinates.length,
markersArray[i].position);

        markersArray[i].setMap(map);
      }
    }
    if (intInfoWindowOpened >= 0) {
      ftnOpenInfoWindow(intInfoWindowOpened);
    }
  }
  map.setCenter(ctrLatLng);
}

function ftnGoToMarker(x_Marker) {
  map.setCenter(x_Marker);
}
==============================================

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to