Je souhaite être en mesure d'ajuster la position du contrôle de type de carte. Je l'ai placé en haut à droite mais je dois le laisser tomber d'environ 50 pixels. J'ai lu sur les contrôles personnalisés que vous pouvez tamponner le DIV, qu'en est-il des contrôles non personnalisés? Puis-je étendre le contrôle?Position personnalisée Google Maps (API v3)
Ci-dessous le code HTML généré par l'API pour le contrôle:
<div class="gmnoprint" style="margin: 5px; z-index: 11; position: absolute; cursor: pointer; text-align: left; top: 0px; right: 0px;">
<div style="width: 80px; position: relative; overflow: hidden; border: 1px solid black;">
<div style="color: black; font-family: Arial,sans-serif; -moz-user-select: none; font-size: 12px; background-color: white; padding: 0px 5px; font-weight: bold; border-width: 1px; border-style: solid; border-color: rgb(112, 112, 112) rgb(208, 208, 208) rgb(208, 208, 208) rgb(112, 112, 112);" title="Change map style">Map<img style="position: absolute; right: 4px; top: 4px; display: block;" src="http://maps.gstatic.com/intl/en_us/mapfiles/down-arrow.gif"></div>
</div>
<div style="border: 1px solid black; width: 80px; display: none;">
<div style="color: black; font-family: Arial,sans-serif; -moz-user-select: none; font-size: 12px; background-color: white; padding: 1px 5px;" title="Show street map">Map</div>
<div style="color: black; font-family: Arial,sans-serif; -moz-user-select: none; font-size: 12px; background-color: white; padding: 1px 5px;" title="Show satellite imagery">Satellite</div>
<div style="color: black; font-family: Arial,sans-serif; -moz-user-select: none; font-size: 12px; background-color: white; padding: 1px 5px;" title="Show imagery with street names">Hybrid</div>
<div style="color: black; font-family: Arial,sans-serif; -moz-user-select: none; font-size: 12px; background-color: white; padding: 1px 5px;" title="Show street map with terrain">Terrain</div>
</div></div>
Comme solution provisoire, je suis en utilisant le code jquery suivant pour modifier le rembourrage de ce contrôle spécifique:
$('[title="Change map style"]').parent().css('padding-top', '36px');
Loin de l'idéal, mais fait le travail dans ce cas:/
double possible (http://stackoverflow.com/questions/2934269/google-maps-api-v3-custom-controls-position) [API Google Maps la position de contrôles personnalisés V3] – Sjoerd
Consultez ma réponse: http://stackoverflow.com/questions/2934269/google-maps-ap3-custom-controls-position/9773082#9773082 – AvL
@Sjoerd Marquage possible de cette double copie et de [Google Maps API V3 position de contrôles personnalisés] (http://stackoverflow.com/questions/2934269/google-maps-api-v3-custom-controls-position) n'est pas logique. Le doublon est probablement la nouvelle question qui est celle-ci .. – hitautodestruct