Changeset 12491 in osm for applications


Ignore:
Timestamp:
2008-12-22T21:33:27+01:00 (16 years ago)
Author:
stoecker
Message:

minor cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wmsplugin/resources/ymap.html

    r11172 r12491  
    5050        map.removeZoomScale();
    5151        var zac = map.getBestZoomAndCenter(points);
    52         var level = zac.zoomLevel;
    53 
    54         // funny Yahoo bug seems to return 0 if your section is too small
    55         if( level == 0 ) level = 1;
    56         if (level>1) level--;
     52        var level = zac.zoomLevel-1;
     53        var levels = map.getZoomValidLevels();
     54        if(levels[0] > level)
     55          level = levels[0];
    5756
    5857        map.drawZoomAndCenter(zac.YGeoPoint,level);
     
    6261        xy1 = map.convertLatLonXY(points[1]);
    6362
    64         // This is hack to bug in getBestZoomAndCenter function
    65         cx = map.convertXYLatLon(new YCoordPoint((xy0.x+xy1.x)/2, (xy0.y+xy1.y)/2));
     63        // Recenter the stuff to have exact edges
     64        cx = map.convertXYLatLon(new YCoordPoint((xy0.x+xy1.x)/2.0, (xy0.y+xy1.y)/2.0));
    6665        map.drawZoomAndCenter(cx,level)
    6766
Note: See TracChangeset for help on using the changeset viewer.