Comment ajouter l'option Zoom à Google Maps

Nouveau WRInaute
Bonjour à tous,
j'ai utilisé le générateur de code qui se trouve ici https://www.google.com/uds/solutions/wiz ... earch.html
pour insérer google maps sur une de mes pages, tout fonctionne bien avec seulement je n'arrive pas à rajouter les options du zoom et du type de carte comme sur la photo

J'ai lu quelque part qu'il fallait placer ces deux lignes dans le code pour appeler ces fonctions, j'ai essayé de les mettre partout mais sans succès .
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());

Quelqu'un pourait-il m'aider SVP ? voici mon code
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

  <script></script>
  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  <title>Carte de la France</title>


<!-- ++Begin Map Search Control Wizard Generated Code++ --><!-- // Created with a Google AJAX Search Wizard // http://code.google.com/apis/ajaxsearch/wizards.html --><!-- // The Following div element will end up holding the map search control. // You can place this anywhere on your page -->
  <style type="text/css">
@import url("https://www.google.com/uds/css/gsearch.css");
  </style>
  <style type="text/css">
@import url("https://www.google.com/uds/solutions/mapsearch/gsmapsearch.css");
  </style>
  <style type="text/css">
.gsmsc-mapDiv {
height : 475px;
}
.gsmsc-idleMapDiv {
height : 475px;
}
#mapsearch {
width : 565px;
margin: 10px;
padding: 4px;
}
  </style>
</head>


<body>
<div style="text-align: left;" id="mapsearch">
<div style="text-align: left;"><span style="margin: 10px; padding: 4px; color: rgb(103, 103, 103); font-size: 11px;">Recherche
en cours...</span></div>

</div>

<div style="text-align: left;"><!-- Maps Api, Ajax Search Api and Stylesheet // Note: If you are already using the Maps API then do not include it again // If you are already using the AJAX Search API, then do not include it // or its stylesheet again // // The Key Embedded in the following script tags is designed to work with // the following site: // http://www.mon-site.com -->
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ma clé API" type="text/javascript"></script>
<script src="https://www.google.com/uds/api?file=uds.js&amp;v=1.0&amp;source=uds-msw&amp;key=ma clé API" type="text/javascript"></script><!-- Map Search Control and Stylesheet -->
<script type="text/javascript">
window._uds_msw_donotrepair = true;
</script>
<script src="https://www.google.com/uds/solutions/mapsearch/gsmapsearch.js?mode=new" type="text/javascript"></script>
<script type="text/javascript">
function LoadMapSearchControl() {
var options = {
zoomControl : GSmapSearchControl.ZOOM_CONTROL_ENABLE_ALL,
title : "France",
url : "http://www.mon-site.com",
idleMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM-6,
activeMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM-6
}
new GSmapSearchControl(
document.getElementById("mapsearch"),
"France",
options
);
}
// arrange for this function to be called during body.onload
// event processing
GSearch.setOnLoadCallback(LoadMapSearchControl);
</script><!-- ++End Map Search Control Wizard Generated Code++ --><br>

</div>

</body>
</html>
 
WRInaute passionné
Il faut faire ca par exemple :
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Google Maps API Example</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=ta_key" type="text/javascript"></script>
    <script type="text/javascript">
    //<![CDATA[

var map = null;

function load() {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		map.addControl(new GScaleControl());
	}
}
    //]]>
    </script>
  </head>

  <body onload="load()" onunload="GUnload()">
    <div id="map" style="width: 500px; height: 300px"></div>
  </body>
</html>
 
Nouveau WRInaute
Merci pour vos réponses mais le code que m'a donné webmasterlamogere ne fonctionne pas chez moi, j'obtiens une page blanche
 
Discussions similaires
Haut