| | 6 | |
|---|
| | 7 | |
|---|
| | 8 | if (typeof GMap2 != "undefined") { |
|---|
| | 9 | |
|---|
| | 10 | /** Hack-on function because GMAPS does not give it to us |
|---|
| | 11 | * |
|---|
| | 12 | * @param {GLatLng} gLatLng |
|---|
| | 13 | * |
|---|
| | 14 | * @returns A GPoint specifying gLatLng translated into "Container" coords |
|---|
| | 15 | * @type GPoint |
|---|
| | 16 | */ |
|---|
| | 17 | GMap2.prototype.fromLatLngToContainerPixel = function(gLatLng) { |
|---|
| | 18 | |
|---|
| | 19 | // first we translate into "DivPixel" |
|---|
| | 20 | var gPoint = this.fromLatLngToDivPixel(gLatLng); |
|---|
| | 21 | |
|---|
| | 22 | // locate the sliding "Div" div |
|---|
| | 23 | // it seems like "b" is the main div |
|---|
| | 24 | var div = this.b.firstChild.firstChild; |
|---|
| | 25 | |
|---|
| | 26 | // adjust by the offset of "Div" and voila! |
|---|
| | 27 | gPoint.x += div.offsetLeft; |
|---|
| | 28 | gPoint.y += div.offsetTop; |
|---|
| | 29 | |
|---|
| | 30 | return gPoint; |
|---|
| | 31 | }; |
|---|
| | 32 | } |
|---|
| 198 | | }, |
|---|
| 199 | | |
|---|
| 200 | | /** Hacked function because GMAPS does not give us |
|---|
| 201 | | * a fromLatLngToContainerPixel. Cheers sde for the |
|---|
| 202 | | * firstChild.firstChild find. |
|---|
| 203 | | * |
|---|
| 204 | | * @param {GLatLng} gLatLng |
|---|
| 205 | | * |
|---|
| 206 | | * @returns A GPoint specifying gLatLng translated into "Container" |
|---|
| 207 | | * coordinates |
|---|
| 208 | | * @type GPoint |
|---|
| 209 | | */ |
|---|
| 210 | | fromLatLngToContainerPixel: function(gLatLng) { |
|---|
| 211 | | |
|---|
| 212 | | // first we translate into "DivPixel" |
|---|
| 213 | | var gPoint = this.gmap.fromLatLngToDivPixel(gLatLng); |
|---|
| 214 | | |
|---|
| 215 | | // locate the sliding "Div" div |
|---|
| 216 | | var div = this.div.firstChild.firstChild; |
|---|
| 217 | | |
|---|
| 218 | | // adjust by the offset of "Div" and voila! |
|---|
| 219 | | gPoint.x += div.offsetLeft; |
|---|
| 220 | | gPoint.y += div.offsetTop; |
|---|
| 221 | | |
|---|
| 222 | | return gPoint; |
|---|