api google earth et google map à l'aide pour intégrer de nouvelles fonctions
bonjour c'est mon premier post sur ce forum.
sur mon site mycomenius
j'ai créé une page intégrant google earth et google map sur plusieurs couches.
Cela marche à condition d'installer le plugin google earth demandé lors du lancement.
Je souhaite modifier la fonction de recherche en ajoutant un envol et un aterrissage en douceur comme sur cette page
Pour simplifier le travail je propose dans un premier temps de mixer le code des 2 pages suivantes
survol en douceur
et superposition des couches google map et google earth
les codes de ces 2 pages sont
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="ltr" lang="notutf8-fr">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<title>Recherche et survol en douceur</title>
<meta name="title" content="Api google earth orientation">
<style type="text/css"></style>
<script src="http://www.google.com/jsapi?key=ABQIAAAAZDoIW1CMRgES87ULstW6KhQYkGc0-09RTj_iHO3dvAccOVoauhTcgHvXBNbtbg0-IsBSlT4YZtICqg"></script>
<script>
google.load("earth", "1");
google.load("maps", "2.99"); // For JS geocoder
function init() {
geocoder = new GClientGeocoder();
google.earth.createInstance("map3d", initCallback, failureCallback);
google.earth.createInstance("map3d", initCB, failureCB);
}
function initCallback(object) {
ge = object;
ge.getWindow().setVisibility(true);
var cam = ge.getView().copyAsCamera(ge.ALTITUDE_ABSOLUTE);
cam.setAltitude(30000000);
ge.getView().setAbstractView(cam);
ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW);
document.getElementById('geplugin_version').innerHTML = ge.getPluginVersion();
}
function failureCallback(object) {
}
function submitLocation() {
var address = document.getElementById('address').value;
geocoder.getLatLng(
address,
function(point) {
if (point && ge != null) {
var la = ge.createLookAt('');
la.set(point.y, point.x, 10, ge.ALTITUDE_RELATIVE_TO_GROUND,
0, 60, 4000);
ge.getView().setAbstractView(la);
}
}
);
}
</script>
</head>
<body onload='init()' id='body' bgcolor="#000000">
<div>
<form name='searchform' id='searchform' action='javascript:submitLocation();void(0);'>
<input type=text size=30 id='address'></input>
<input type=submit value='Go !'>
</form>
</div>
<center>
<div id='map3d_container'
style='border: 0px solid silver; height: 650px;'>
<div id='map3d' style='height: 100%;'>
</div>
</div>
</center>
</body>
</html> |
et
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| <!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"
xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title>Using Google Earth API with the Maps API</title>
<script src="http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAAZDoIW1CMRgES87ULstW6KhQYkGc0-09RTj_iHO3dvAccOVoauhTcgHvXBNbtbg0-IsBSlT4YZtICqg"
type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
// commandes pour relief
map.addMapType(G_PHYSICAL_MAP);
map.addMapType(G_SATELLITE_3D_MAP);
map.addControl(new GHierarchicalMapTypeControl());
// commande module déplacement orientation carte
map.addControl(new GLargeMapControl());
// commande pour démarrer sur google earth
map.setMapType(G_SATELLITE_3D_MAP);
// commandes pour bouton multi commandes en lève ces 3 lignes pour avoir la rangée de boutons et place du bouton
map.addControl(new GMenuMapTypeControl(), new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(0,0)));
map.addOverlay(marker);
// Obtain a pointer to the Google Earth instance attached to
// your map.
map.getEarthInstance(getEarthInstanceCB);
}
var ge;
function getEarthInstanceCB(object) {
ge = object;
// You can now manipulate ge using the full Google Earth API.
}
</script>
</head>
<body onload="initialize()" onunload="GUnload">
<div id="map" class="map" style="width:900px;height:500px"></div>
</body>
</html> |
merci à un développeur qui pourrait m'aider à sortir de là
didier