Bonsoir,

je suis nouveau avec l'API google map et j'utilise JSF

dans cet exemple de code, je veux faire appel à mes fonctions java pour obtenir des latitudes et des longitudes à partir de ma base de données.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
<html>
    <head>
        <style type="text/css">
 
        </style>
        <script type="text/javascript"
            src="http://maps.google.com/maps/api/js?sensor=false" ></script>
        <script type="text/javascript">
           function initialize(){
            var latlng = new google.maps.LatLng(48.3929, -4.4798);
            var myOptions = {
            zoom: 11,
            center: latlng,
            mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
            var brest = new google.maps.LatLng(<%Mon code JSF qui appelle du java>, -4.4798);
            var paris = new google.maps.LatLng(<%Mon code JSF qui appelle du java>, 2.3479);
            var polyligne = new google.maps.Polyline({
            path: [brest, paris],
            map: map
            });
 
            }
 
 
        </script>
    </head>
    <body onload="initialize()" >
        <div id="map_canvas" style="width: 800px; height: 500px; margin-top: 100px;margin-left: 100px;">
 
        </div>
    </body>
 
</html>
Merci pour votre aide