finishing touches of first draft of yahoo layer. adding correct script tag, fixing zoom levels business, etc.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@615 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// @require: OpenLayers/Layer.js
|
// @require: OpenLayers/Layer.js
|
||||||
|
|
||||||
// load Yahoo map control script
|
// load Yahoo map control script
|
||||||
document.write("<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAmQ3udCHPQVB_9T_edFZ7YRRRlP-tOiFgaSzksg_0w1dphL9c5BTfdJMKT91b0UJGibNcWEM0Q5-O1w'></script>");
|
document.write("<script src='http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers'></script>");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class
|
* @class
|
||||||
@@ -46,14 +46,14 @@ OpenLayers.Layer.Yahoo.prototype = Object.extend( new OpenLayers.Layer(), {
|
|||||||
if ((this.ymap != null) && (!this.dragging)) {
|
if ((this.ymap != null) && (!this.dragging)) {
|
||||||
|
|
||||||
var olCenter = this.map.getCenter();
|
var olCenter = this.map.getCenter();
|
||||||
var gCenter = this.getYMapCenter();
|
var yCenter = this.getYMapCenter();
|
||||||
|
|
||||||
var olZoom = this.map.getZoom();
|
var olZoom = this.map.getZoom();
|
||||||
var gZoom = this.ymap.getZoomLevel();
|
var yZoom = this.ymap.getZoomLevel();
|
||||||
|
|
||||||
if ((!olCenter.equals(yCenter)) || ((olZoom +1) != yZoom)) {
|
if ((!olCenter.equals(yCenter)) || (( 16 - olZoom) != yZoom)) {
|
||||||
this.ymap.drawZoomAndCenter(new YGeoPoint(olCenter.lat, olCenter.lon),
|
this.ymap.drawZoomAndCenter(new YGeoPoint(olCenter.lat, olCenter.lon),
|
||||||
olZoom + 1);
|
16 - olZoom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -71,27 +71,22 @@ OpenLayers.Layer.Yahoo.prototype = Object.extend( new OpenLayers.Layer(), {
|
|||||||
|
|
||||||
// create GMap, hide nav controls
|
// create GMap, hide nav controls
|
||||||
this.ymap = new YMap(this.div);
|
this.ymap = new YMap(this.div);
|
||||||
this.moveTo();
|
// this.moveTo();
|
||||||
|
|
||||||
// catch pans and zooms from GMap
|
// catch pans and zooms from GMap
|
||||||
var e = new YEvent(this.ymap,
|
YEvent.Capture(this.ymap,
|
||||||
"endpan",
|
EventsList.endPan,
|
||||||
catchPanZoom,
|
this.catchPanZoom,
|
||||||
this);
|
this);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
// attach to the drag start and end and we´ll set a flag so that
|
// attach to the drag start and end and we´ll set a flag so that
|
||||||
// we dont get recursivity. this is because the events fall through
|
// we dont get recursivity. this is because the events fall through
|
||||||
// the gmaps div and into the main layer div
|
// the gmaps div and into the main layer div
|
||||||
GEvent.addListener(this.gmap,
|
YEvent.Capture(this.ymap,
|
||||||
"dragstart",
|
EventsList.startPan,
|
||||||
this.dragStart.bindAsEventListener(this));
|
this.dragStart,
|
||||||
|
this);
|
||||||
GEvent.addListener(this.gmap,
|
|
||||||
"dragend",
|
|
||||||
this.dragEnd.bindAsEventListener(this));
|
|
||||||
*/
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -102,23 +97,18 @@ OpenLayers.Layer.Yahoo.prototype = Object.extend( new OpenLayers.Layer(), {
|
|||||||
this.dragging = true;
|
this.dragging = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
dragEnd: function() {
|
|
||||||
this.dragging = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*
|
*
|
||||||
* @param {event} e
|
* @param {event} e
|
||||||
*/
|
*/
|
||||||
catchPanZoom: function(e) {
|
catchPanZoom: function(e) {
|
||||||
|
this.dragging = false;
|
||||||
|
|
||||||
var olCenter = this.getYMapCenter();
|
var olCenter = this.getYMapCenter();
|
||||||
var yZoom = this.ymap.getZoomLevel();
|
var yZoom = this.ymap.getZoomLevel();
|
||||||
|
|
||||||
this.map.setCenter(olCenter, yZoom - 1);
|
this.map.setCenter(olCenter, 16 - yZoom);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user