| 5 | | if (typeof GMap2 != "undefined") { |
|---|
| 6 | | |
|---|
| 7 | | /** Hack-on function because GMAPS does not give it to us |
|---|
| 8 | | * |
|---|
| 9 | | * @param {GLatLng} gLatLng |
|---|
| 10 | | * |
|---|
| 11 | | * @returns A GPoint specifying gLatLng translated into "Container" coords |
|---|
| 12 | | * @type GPoint |
|---|
| 13 | | */ |
|---|
| 14 | | GMap2.prototype.fromLatLngToContainerPixel = function(gLatLng) { |
|---|
| 15 | | |
|---|
| 16 | | // first we translate into "DivPixel" |
|---|
| 17 | | var gPoint = this.fromLatLngToDivPixel(gLatLng); |
|---|
| 18 | | |
|---|
| 19 | | // locate the sliding "Div" div |
|---|
| 20 | | // it seems like "b" is the main div |
|---|
| 21 | | var div = this.b.firstChild.firstChild; |
|---|
| 22 | | |
|---|
| 23 | | // adjust by the offset of "Div" and voila! |
|---|
| 24 | | gPoint.x += div.offsetLeft; |
|---|
| 25 | | gPoint.y += div.offsetTop; |
|---|
| 26 | | |
|---|
| 27 | | return gPoint; |
|---|
| 28 | | }; |
|---|
| 29 | | } |
|---|
| | 5 | |
|---|
| | 6 | |
|---|
| 434 | | |
|---|
| 435 | | |
|---|
| | 411 | |
|---|
| | 412 | addContainerPxFunction: function() { |
|---|
| | 413 | if (typeof GMap2 != "undefined" && !GMap2.fromLatLngToContainerPixel) { |
|---|
| | 414 | |
|---|
| | 415 | /** Hack-on function because GMAPS does not give it to us |
|---|
| | 416 | * |
|---|
| | 417 | * @param {GLatLng} gLatLng |
|---|
| | 418 | * |
|---|
| | 419 | * @returns A GPoint specifying gLatLng translated into "Container" coords |
|---|
| | 420 | * @type GPoint |
|---|
| | 421 | */ |
|---|
| | 422 | GMap2.prototype.fromLatLngToContainerPixel = function(gLatLng) { |
|---|
| | 423 | |
|---|
| | 424 | // first we translate into "DivPixel" |
|---|
| | 425 | var gPoint = this.fromLatLngToDivPixel(gLatLng); |
|---|
| | 426 | |
|---|
| | 427 | // locate the sliding "Div" div |
|---|
| | 428 | // it seems like "b" is the main div |
|---|
| | 429 | var div = this.b.firstChild.firstChild; |
|---|
| | 430 | |
|---|
| | 431 | // adjust by the offset of "Div" and voila! |
|---|
| | 432 | gPoint.x += div.offsetLeft; |
|---|
| | 433 | gPoint.y += div.offsetTop; |
|---|
| | 434 | |
|---|
| | 435 | return gPoint; |
|---|
| | 436 | }; |
|---|
| | 437 | } |
|---|
| | 438 | }, |
|---|