Advertisement
Guest User

Untitled

a guest
Apr 8th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. var map;
  2. var initialize;
  3.  
  4. initialize = function(){
  5. var latLng = new google.maps.LatLng(x,y);
  6. var myOptions = {
  7. zoom : 14,
  8. center : latLng,
  9. mapTypeId : google.maps.MapTypeId.TERRAIN,
  10. maxZoom : 20
  11. };
  12.  
  13. map = new google.maps.Map(document.getElementById('map'), myOptions);
  14.  
  15. var marker = new google.maps.Marker({
  16. position : latLng,
  17. map : map,
  18. title : "sousse"
  19. //icon : "marker_sousse.gif"
  20. });
  21.  
  22. package beans;
  23.  
  24. import .
  25. .
  26. .
  27. .
  28. .
  29.  
  30.  
  31. @ManagedBean(name = "js")
  32. @RequestScoped
  33. public class Map {
  34. ArrayList<String> Listlat = new ArrayList<String>();
  35. ArrayList<String> Listlng = new ArrayList<String>();
  36. GestionAnalyseLocal m;
  37. ResultSet resultSet;
  38.  
  39. public Map() {
  40. try {
  41. Class.forName("com.mysql.jdbc.Driver");
  42. Connection connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/pfedb", "root", "");
  43. Statement statement = connect.createStatement();
  44. resultSet = statement.executeQuery("select * from t_analyse");
  45. } catch (Exception e) {
  46. System.out.println("erreur" + e);
  47. e.printStackTrace();
  48. }
  49.  
  50. }
  51. public ArrayList<String> ExtractLat(ResultSet rs) {
  52. try {
  53. while (rs.next()) {
  54. Listlat.add(rs.getString("latitude"));
  55.  
  56. }
  57. } catch (Exception e) {
  58. System.out.println("erreur" + e);
  59. e.printStackTrace();
  60. }
  61. return Listlat;
  62. }
  63.  
  64. public ArrayList<String> ExtractLng(ResultSet rs) {
  65. try {
  66. while (rs.next()) {
  67. Listlng.add(rs.getString("Longitude"));
  68.  
  69. }
  70. } catch (Exception e) {
  71. System.out.println("erreur" + e);
  72. e.printStackTrace();
  73. }
  74. return Listlng;
  75. }
  76. }
  77.  
  78. <!DOCTYPE html>
  79. <html >
  80. <ui:composition xmlns="http://www.w3.org/1999/xhtml"
  81. xmlns:f="http://xmlns.jcp.org/jsf/core"
  82. xmlns:h="http://xmlns.jcp.org/jsf/html"
  83. xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
  84. xmlns:jsf="http://xmlns.jcp.org/jsf"
  85. xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
  86. xmlns:p="http://primefaces.org/ui"
  87. template="/WEB-INF/template/template.xhtml"
  88. >
  89. <ui:define name="title">Map</ui:define>
  90. <ui:define name="content">
  91.  
  92. <head>
  93.  
  94.  
  95. <link rel="stylesheet" href="jquery-ui-1.8.12.custom.css" type="text/css" />
  96. </head>
  97. <style type="text/css">
  98. #container{position:relative;width:990px;margin:auto;}
  99. #container #map{width:500px;height:500px;margin:auto;}
  100. </style>
  101. <body>
  102. <div id="container">
  103. <div id="map">
  104. <p>Veuillez patienter pendant le chargement de la carte...</p>
  105. </div>
  106. </div>
  107.  
  108. <!-- Include Javascript -->
  109. <h:form>
  110. <p:remoteCommand name="rc" update="msgs" actionListener="#{remoteCommandView.execute}" />
  111. <p:growl id="msgs" showDetail="true" />
  112. <p:commandButton type="button" onclick="rc()" value="Execute" icon="ui-icon-refresh" />
  113. </h:form>
  114. <script type="text/javascript" src="resources/js/jquery.min.js"></script>
  115. <script type="text/javascript" src="resources/js/jquery-ui-1.8.12.custom.min.js"></script>
  116. <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
  117. <script type="text/javascript" src="resources/js/functions.js"></script>
  118.  
  119. </body>
  120. </ui:define>
  121. </ui:composition>
  122. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement