| 106 | | // move the ToS and branding stuff up to the pane |
|---|
| 107 | | // thanks a *mil* Erik for thinking of this |
|---|
| 108 | | var poweredBy = this.div.lastChild; |
|---|
| 109 | | this.div.removeChild(poweredBy); |
|---|
| 110 | | this.pane.appendChild(poweredBy); |
|---|
| 111 | | poweredBy.className = "olLayerGooglePoweredBy gmnoprint"; |
|---|
| 112 | | poweredBy.style.left = ""; |
|---|
| 113 | | poweredBy.style.bottom = ""; |
|---|
| | 106 | // Move GMap's special divs to eventPane so they can be clicked. |
|---|
| | 107 | this.moveSpecialDivsToEventPane(); |
|---|
| | 147 | * Method: moveSpecialDivsToEventPane |
|---|
| | 148 | * Move the "Powered By" and "Terms of Use" divs to the eventPane so that |
|---|
| | 149 | * the user will still be able to click on them. |
|---|
| | 150 | */ |
|---|
| | 151 | moveSpecialDivsToEventPane: function() { |
|---|
| | 152 | // move the ToS and branding stuff up to the pane |
|---|
| | 153 | // thanks a *mil* Erik for thinking of this |
|---|
| | 154 | var poweredBy = this.div.lastChild; |
|---|
| | 155 | if (poweredBy) { |
|---|
| | 156 | this.div.removeChild(poweredBy); |
|---|
| | 157 | this.pane.appendChild(poweredBy); |
|---|
| | 158 | poweredBy.className = "olLayerGooglePoweredBy gmnoprint"; |
|---|
| | 159 | poweredBy.style.left = ""; |
|---|
| | 160 | poweredBy.style.bottom = ""; |
|---|
| | 161 | } else { |
|---|
| | 162 | var msg = "Google Maps has changed its internal " + |
|---|
| | 163 | "workings and has therefore caused an error in " + |
|---|
| | 164 | "the OpenLayers.Layer.Google layer. " + |
|---|
| | 165 | "Specifically, OL was unable to find the " + |
|---|
| | 166 | "'Powered By' div to move it to the eventPane."; |
|---|
| | 167 | OpenLayers.Console.warn(msg); |
|---|
| | 168 | } |
|---|
| | 169 | |
|---|
| | 170 | var termsOfUse = this.div.lastChild; |
|---|
| | 171 | if (termsOfUse) { |
|---|
| | 172 | this.div.removeChild(termsOfUse); |
|---|
| | 173 | this.pane.appendChild(termsOfUse); |
|---|
| | 174 | termsOfUse.className = "olLayerGoogleCopyright"; |
|---|
| | 175 | termsOfUse.style.right = ""; |
|---|
| | 176 | termsOfUse.style.bottom = ""; |
|---|
| | 177 | } else { |
|---|
| | 178 | var msg = "Google Maps has changed its internal " + |
|---|
| | 179 | "workings and has therefore caused an error in " + |
|---|
| | 180 | "the OpenLayers.Layer.Google layer. " + |
|---|
| | 181 | "Specifically, OL was unable to find the " + |
|---|
| | 182 | "'Terms of Use' div to move it to the eventPane."; |
|---|
| | 183 | OpenLayers.Console.warn(msg); |
|---|
| | 184 | } |
|---|
| | 185 | }, |
|---|
| | 186 | |
|---|
| | 187 | /** |
|---|
| 276 | | var div = this.getContainer().firstChild.firstChild; |
|---|
| | 304 | var container = this.getContainer(); |
|---|
| | 305 | |
|---|
| | 306 | //it's the grandchild of the container that has the |
|---|
| | 307 | // offset information we need. if we can't find the |
|---|
| | 308 | // grandchild, we'll just return the divpx. not ideal, but |
|---|
| | 309 | // yes better than a script error |
|---|
| | 310 | if (container.firstChild && container.firstChild.firstChild) { |
|---|
| | 311 | var div = this.getContainer().firstChild.firstChild; |
|---|
| 278 | | // adjust by the offset of "Div" and voila! |
|---|
| 279 | | gPoint.x += div.offsetLeft; |
|---|
| 280 | | gPoint.y += div.offsetTop; |
|---|
| 281 | | |
|---|
| | 313 | // adjust by the offset of "Div" and voila! |
|---|
| | 314 | gPoint.x += div.offsetLeft; |
|---|
| | 315 | gPoint.y += div.offsetTop; |
|---|
| | 316 | } else { |
|---|
| | 317 | var msg = "Google Maps has changed its internal " + |
|---|
| | 318 | "workings and has therefore caused an error in " + |
|---|
| | 319 | "the OpenLayers.Layer.Google layer. " + |
|---|
| | 320 | "Specifically, OL was unable to find the proper " + |
|---|
| | 321 | "grandchild of the container div to translate " + |
|---|
| | 322 | "LatLng to ContainerPixel."; |
|---|
| | 323 | OpenLayers.Console.warn(msg); |
|---|
| | 324 | } |
|---|
| | 325 | |
|---|