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
|
||||
|
||||
// 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
|
||||
@@ -46,14 +46,14 @@ OpenLayers.Layer.Yahoo.prototype = Object.extend( new OpenLayers.Layer(), {
|
||||
if ((this.ymap != null) && (!this.dragging)) {
|
||||
|
||||
var olCenter = this.map.getCenter();
|
||||
var gCenter = this.getYMapCenter();
|
||||
var yCenter = this.getYMapCenter();
|
||||
|
||||
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),
|
||||
olZoom + 1);
|
||||
16 - olZoom);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -71,27 +71,22 @@ OpenLayers.Layer.Yahoo.prototype = Object.extend( new OpenLayers.Layer(), {
|
||||
|
||||
// create GMap, hide nav controls
|
||||
this.ymap = new YMap(this.div);
|
||||
this.moveTo();
|
||||
// this.moveTo();
|
||||
|
||||
// catch pans and zooms from GMap
|
||||
var e = new YEvent(this.ymap,
|
||||
"endpan",
|
||||
catchPanZoom,
|
||||
this);
|
||||
YEvent.Capture(this.ymap,
|
||||
EventsList.endPan,
|
||||
this.catchPanZoom,
|
||||
this);
|
||||
|
||||
|
||||
/**
|
||||
// attach to the drag start and end and we<77>ll set a flag so that
|
||||
// we dont get recursivity. this is because the events fall through
|
||||
// the gmaps div and into the main layer div
|
||||
GEvent.addListener(this.gmap,
|
||||
"dragstart",
|
||||
this.dragStart.bindAsEventListener(this));
|
||||
|
||||
GEvent.addListener(this.gmap,
|
||||
"dragend",
|
||||
this.dragEnd.bindAsEventListener(this));
|
||||
*/
|
||||
YEvent.Capture(this.ymap,
|
||||
EventsList.startPan,
|
||||
this.dragStart,
|
||||
this);
|
||||
|
||||
},
|
||||
|
||||
@@ -102,23 +97,18 @@ OpenLayers.Layer.Yahoo.prototype = Object.extend( new OpenLayers.Layer(), {
|
||||
this.dragging = true;
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
dragEnd: function() {
|
||||
this.dragging = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param {event} e
|
||||
*/
|
||||
catchPanZoom: function(e) {
|
||||
this.dragging = false;
|
||||
|
||||
var olCenter = this.getYMapCenter();
|
||||
var yZoom = this.ymap.getZoomLevel();
|
||||
|
||||
this.map.setCenter(olCenter, yZoom - 1);
|
||||
this.map.setCenter(olCenter, 16 - yZoom);
|
||||
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user