Changeset 1537
- Timestamp:
- 10/03/06 00:34:51 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Control/Permalink.js
r1424 r1537 37 37 var args = OpenLayers.Util.getArgs(); 38 38 if (args.lat && args.lon) { 39 this.map.setCenter( 40 new OpenLayers.LonLat(parseFloat(args.lon), parseFloat(args.lat)) 41 ); 39 if (this.map.baseLayer) { 40 this.map.setCenter( 41 new OpenLayers.LonLat(parseFloat(args.lon), parseFloat(args.lat)) 42 ); 43 } else { 44 this.centerData = new OpenLayers.LonLat( 45 parseFloat(args.lon), 46 parseFloat(args.lat)); 47 this.map.events.register( 'changebaselayer', this, this.setCenter); 48 } 42 49 } 43 50 if (args.zoom) { 44 this.map.zoomTo(parseInt(args.zoom)); 51 if (this.map.baseLayer) { 52 this.map.zoomTo(parseInt(args.zoom)); 53 } else { 54 this.zoomData = parseInt(args.zoom); 55 } 45 56 } 46 57 if (!this.element) { … … 71 82 this.element.href = this.base+"?lat="+lat+"&lon="+lon+"&zoom="+zoom; 72 83 }, 84 85 setCenter: function() { 86 if (this.map.baseLayer && this.centerData) { 87 this.map.setCenter(this.centerData, this.zoomData ? this.zoomData : null); 88 this.centerData = null; 89 } 90 }, 91 92 73 93 74 94 /** @final @type String */
