Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 KB | None | 0 0
  1. var map = new google.maps.Map(document.getElementById('map'), {
  2. zoom: 17,
  3. center: new google.maps.LatLng(
  4. <?php
  5. include_once('connection.php');
  6.  
  7. $conn=SQL_CONNECT();
  8.  
  9. $sitename=$_POST['sitename'];
  10. $stid = oci_parse($conn, "SELECT * FROM latlong where SITEID like '%$sitename%'");
  11.  
  12. $res=oci_execute($stid);
  13.  
  14.  
  15. while($data = oci_fetch_array($stid))
  16. {
  17. //if($data['LAT']=="28.149699")
  18. {
  19. echo $data['LAT'].",".$data['LON'];
  20. }
  21. }
  22. oci_close($conn);
  23. ?>
  24.  
  25. ),
  26.  
  27. mapTypeId: google.maps.MapTypeId.ROADMAP
  28. });
  29.  
  30.  
  31.  
  32. var infowindow = new google.maps.InfoWindow();
  33.  
  34. var marker, i, text;
  35.  
  36. for (i = 0; i < locations.length; i++) {
  37. marker = new google.maps.Marker({
  38. position: new google.maps.LatLng(locations[i][1], locations[i][2]),
  39. map: map
  40. });
  41.  
  42. text = locations[i][0];
  43.  
  44. if(locations[i][1] === lat_center && locations[i][2] === long_center) {
  45.  
  46. marker.setAnimation(google.maps.Animation.DROP);
  47.  
  48. marker.setIcon('http://www.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png');
  49.  
  50. //text += '<br>' + 'Additionl text for centered marker';
  51.  
  52. map.Overlay= new google.maps.OverlayView();
  53.  
  54. map.Overlay.center_ = new google.maps.LatLng(lat_center, long_center);
  55. map.Overlay.reddot_ = '<div id="reddot" class="reddot" style="position:relative;"><svg class="marker" height="66" width="66"><circle cy="33" cx="33" class="mark" r="25"><set id="show" attributeName="visibility" attributeType="CSS" to="visible" begin="0s; hide.end" dur="1s" fill="freeze"/><set id="hide" attributeName="visibility" attributeType="CSS" to="hidden" begin="show.end" dur="1s" fill="freeze"/></circle><img src="http://www.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png" class="locater"></svg></div>';
  56.  
  57. map.Overlay.draw = function () {
  58. var pixelposition = this.getProjection().fromLatLngToDivPixel(this.center_);
  59. jQuery('#reddot').css({top:(pixelposition.y-50), left:(pixelposition.x-33)});
  60.  
  61. };
  62.  
  63. map.Overlay.onAdd=function() {
  64. var self=this;
  65. jQuery(self.getPanes().markerLayer).append(self.reddot_);
  66. };
  67.  
  68. map.Overlay.setMap(map);
  69.  
  70. }
  71.  
  72. google.maps.event.addListener(marker, 'mouseover', (function(marker, text) {
  73. return function() {
  74. infowindow.setContent(text);
  75. infowindow.open(map, marker);
  76. }
  77. })(marker, text));
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement