No longer touching internal GMaps DOM elements.

Simple and effective: As soon as a map has a Google layer, the whole map viewport is added as control to the GMap. As soon as no Google layer is visible on the map any more, the map viewport is appended to the map container again. With this change, OpenLayers strictly limits its GMaps integration to the GMaps API.

Also note that there are no css overrides for the attribution any more. Instead, controls can now be conditionally positioned differently for Google layer by using the .olForeignContainer selector.
This commit is contained in:
ahocevar
2012-07-20 17:43:05 +02:00
parent 6075b599f3
commit 00d9664b95
7 changed files with 92 additions and 260 deletions

View File

@@ -17,6 +17,10 @@
right: inherit;
width: 400px;
}
/* conditionally position control differently for Google Maps */
.olForeignContainer div.olControlMousePosition {
bottom: 28px;
}
#map {
height: 512px;
}
@@ -38,7 +42,12 @@
</p>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
<div id="docs">
<p>Note that maps with Google layers are a special case, because we
cannot control the position of the attribution. To conditionally
position controls differently for Google layers, prepend the
css selector with <code>.olForeignContainer</code>.</p>
</div>
<script type="text/javascript">
var map = new OpenLayers.Map({