Advertisement
contatowellington

Untitled

Oct 17th, 2017
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.43 KB | None | 0 0
  1. <?php require_once('../../Connections/cartograxarpi.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6. if (PHP_VERSION < 6) {
  7. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  8. }
  9.  
  10. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  11.  
  12. switch ($theType) {
  13. case "text":
  14. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  15. break;
  16. case "long":
  17. case "int":
  18. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  19. break;
  20. case "double":
  21. $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  22. break;
  23. case "date":
  24. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  25. break;
  26. case "defined":
  27. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  28. break;
  29. }
  30. return $theValue;
  31. }
  32. }
  33.  
  34. mysql_select_db($database_cartograxarpi, $cartograxarpi);
  35. $query_Recordset1 = "SELECT * FROM cadastro_xarpi ORDER BY id DESC";
  36. $Recordset1 = mysql_query($query_Recordset1, $cartograxarpi) or die(mysql_error());
  37. $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  38. $totalRows_Recordset1 = mysql_num_rows($Recordset1);
  39. ?>
  40. <!DOCTYPE html>
  41. <html>
  42. <head>
  43. <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
  44. <meta charset="utf-8">
  45. <title>Complex icons</title>
  46. <style>
  47. /* Always set the map height explicitly to define the size of the div
  48. * element that contains the map. */
  49. #map {
  50. height: 100%;
  51. }
  52. /* Optional: Makes the sample page fill the window. */
  53. html, body {
  54. height: 100%;
  55. margin: 0;
  56. padding: 0;
  57. }
  58. </style>
  59. </head>
  60. <body>
  61. <div id="map"></div>
  62. <script>
  63.  
  64. // The following example creates complex markers to indicate beaches near
  65. // Sydney, NSW, Australia. Note that the anchor is set to (0,32) to correspond
  66. // to the base of the flagpole.
  67.  
  68. function initMap() {
  69. var map = new google.maps.Map(document.getElementById('map'), {
  70. zoom: 10,
  71. center: {lat: -33.9, lng: 151.2}
  72. });
  73.  
  74. setMarkers(map);
  75. }
  76.  
  77. // Data for the markers consisting of a name, a LatLng and a zIndex for the
  78. // order in which these markers should display on top of each other.
  79. var beaches = [
  80. ['Bondi Beach', <?php echo $row_Recordset1['txtLatitude']; ?>, <?php echo $row_Recordset1['txtLongitude']; ?>, 4],
  81.  
  82. ];
  83.  
  84. function setMarkers(map) {
  85. // Adds markers to the map.
  86.  
  87. // Marker sizes are expressed as a Size of X,Y where the origin of the image
  88. // (0,0) is located in the top left of the image.
  89.  
  90. // Origins, anchor positions and coordinates of the marker increase in the X
  91. // direction to the right and in the Y direction down.
  92. var image = {
  93. url: 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png',
  94. // This marker is 20 pixels wide by 32 pixels high.
  95. size: new google.maps.Size(20, 32),
  96. // The origin for this image is (0, 0).
  97. origin: new google.maps.Point(0, 0),
  98. // The anchor for this image is the base of the flagpole at (0, 32).
  99. anchor: new google.maps.Point(0, 32)
  100. };
  101. // Shapes define the clickable region of the icon. The type defines an HTML
  102. // <area> element 'poly' which traces out a polygon as a series of X,Y points.
  103. // The final coordinate closes the poly by connecting to the first coordinate.
  104. var shape = {
  105. coords: [1, 1, 1, 20, 18, 20, 18, 1],
  106. type: 'poly'
  107. };
  108. for (var i = 0; i < beaches.length; i++) {
  109. var beach = beaches[i];
  110. var marker = new google.maps.Marker({
  111. position: {lat: beach[1], lng: beach[2]},
  112. map: map,
  113. icon: image,
  114. shape: shape,
  115. title: beach[0],
  116. zIndex: beach[3]
  117. });
  118. }
  119. }
  120. </script>
  121. <script async defer
  122. src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDBKsHc4tAKAyE8hG-JeFx-PcqDNTK7oj4&callback=initMap">
  123. </script>
  124. </body>
  125. </html>
  126. <?php
  127. mysql_free_result($Recordset1);
  128. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement