Changeset 175


Ignore:
Timestamp:
Oct 25, 2006, 5:00:51 PM (13 years ago)
Author:
David Sheldon
Message:

Fix problem with IE drawing markers in wrong place on first load.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/static/tiles/mapTiles.js

    r172 r175  
    1818
    1919var zoomLevel = 1;
     20
     21var firstTime = 1;
    2022
    2123var prefixes = new Array(1);
     
    268270  maxNorthing= minNorthing + sizeGridY;
    269271
    270   if (zoomLevel == 1) drawExisting();
     272  if (zoomLevel == 1) {
     273                if ((firstTime == 1)&& document.all) {
     274                        setTimeout(drawExisting, 1000);
     275                }       else { drawExisting();}
     276        }
     277  firstTime = 0;
    271278        updatePermalink();
    272279}
    273280
    274281function drawExisting() {
    275  
    276282  var url = "../../cgi/get-postcodes.fcgi";
    277283  url += "?mineasting=" + minEasting + "000&maxeasting="  + maxEasting + "000&minnorthing=" + minNorthing + "000&maxnorthing=" + maxNorthing+"000";
     
    295301  mainPageElement.appendChild(newMarker);
    296302
    297   bottomLeft = YAHOO.util.Dom.getXY('element1.1');
    298   var bottom = bottomLeft[1] + tileHeight;
    299   YAHOO.util.Dom.setXY(newMarker, [bottomLeft[0] - markerXOffset, bottom - markerYOffset]);
     303  topLeft = YAHOO.util.Dom.getXY('element1.' + sizeGridY);
     304  var bottom = topLeft[1] + (tileHeight*sizeGridY);
     305 
     306  YAHOO.util.Dom.setXY(newMarker, [topLeft[0] - markerXOffset, bottom - markerYOffset]);
     307 
    300308
    301309  markerLeft = parseInt(newMarker.style.left);
Note: See TracChangeset for help on using the changeset viewer.