[OpenLayers-Trac] [OpenLayers] #3586: update to openlayers-2.11 caused to not showing map

OpenLayers trac-20090302 at openlayers.org
Mon Nov 28 06:45:25 EST 2011


#3586: update to openlayers-2.11 caused to not showing map
----------------------+-----------------------------------------------------
 Reporter:  hs21897   |       Owner:              
     Type:  bug       |      Status:  new         
 Priority:  critical  |   Milestone:  2.12 Release
Component:  general   |     Version:  2.11        
 Keywords:            |       State:              
----------------------+-----------------------------------------------------
 i'h updated openlayers to 2.11 version but it not working now.
 after updating the openlayers.js file with new one, generated urls for
 tiles changed to "http://blablabla/images/tiles/base/12/0/0.png", but the
 correct one is "http://blablabla/images/tiles/base/11/1316/806.png".

 this is my code:


  options: {
         defaultLat: 35.697,
         defaultLon: 51.366,
         defaultZoom: 11,
         markerZIndex: 11,
         markerShadowZIndex: 10,
         proj: new OpenLayers.Projection("EPSG:4326"),
         mapProj: new OpenLayers.Projection("EPSG:900913"),
         mapSeverPath1: 'http://beta.avval.ir/images/tiles/',
         mapSeverPath2: 'http://beta.avval.ir/images/tiles/',
         mapSeverPath3: 'http://beta.avval.ir/images/tiles/',
         mapBounds: [51.091041, 35.509701, 51.626207, 35.8765], // Tehran
 boundry - Xmin, Ymin, Xmax, Ymax
         openLayersImgPath: '/images/map/dark/',
         markerIconPath: '/images/map/marker.png',
         markerIconShadowPath: '/images/map/marker-shadow.png',
         markers: [],
         overlayMaps: [],
         permalink: null
     },
     initialize: function (container, options) {
         this.setOptions(options);

         OpenLayers.ImgPath = this.options.openLayersImgPath;
         var fullExtent = new
 OpenLayers.Bounds.fromArray(this.options.mapBounds).transform(this.options.proj,
 this.options.mapProj);
         this.map = new OpenLayers.Map(container, {
             controls: [
                                         new
 OpenLayers.Control.Navigation(),
                                         new
 OpenLayers.Control.PanZoomBar(),
                                         new OpenLayers.Control.ScaleLine({
 geodesic: true }),
                                         new
 OpenLayers.Control.Attribution()
                                         ],
             maxExtent: fullExtent,
             restrictedExtent: fullExtent,
             units: 'm'

         });
         if (this.options.permalink) {
             this.map.addControl(new
 OpenLayers.Control.Permalink(this.options.permalink));
         }

         var BaseMapUrlArray = [
                                 this.options.mapSeverPath1 +
 "base/${z}/${x}/${y}.png",
                                 this.options.mapSeverPath2 +
 "base/${z}/${x}/${y}.png",
                                 this.options.mapSeverPath3 +
 "base/${z}/${x}/${y}.png",
                         ];
         var baseMapOptions = {
             sphericalMercator: true,
             buffer: 0,
             transitionEffect: "resize",
             attribution: "<div id='ka-logo'></div>",
             minZoomLevel: 11,
             zoomOffset: 11,
             numZoomLevels: 6,
             displayInLayerSwitcher: false
         };
         ketabeavvalBaseMap = new OpenLayers.Layer.XYZ("Base Map",
 BaseMapUrlArray, baseMapOptions);
         this.map.addLayer(ketabeavvalBaseMap);

         if (this.options.overlayMaps.length >= 1) {
             this.addOverlayMaps(this.options.overlayMaps);
         }
         if (this.options.markers.length >= 1) {
             this.addMarkers(this.options.markers);
         }
         var centerlonLat = new OpenLayers.LonLat(this.defaultLon,
 this.options.defaultLat).transform(this.options.proj,
 this.map.getProjectionObject());
         var zoom = this.options.defaultZoom;
         if (!this.map.getCenter()) {
             this.map.setCenter(centerlonLat, zoom);
         }

         return this;

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3586>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list