Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. success: function (data) {
  2. var table = "<table class='table'>";
  3. $.each(data, function (index, value) {
  4. table += "<tr><td>" + value.Model_ID + "</td></tr>";
  5. var latlng = new google.maps.LatLng(value.MapLat,
  6. value.MapLong);
  7.  
  8.  
  9.  
  10. var marker = new google.maps.Marker({
  11. position: latlng,
  12. icon: "../car-dealer.svg",
  13. animation: google.maps.Animation.DROP,
  14. map: map
  15. });
  16.  
  17.  
  18.  
  19. gmarkers.push(marker);
  20. });
  21.  
  22. success: function (data) {
  23.  
  24.  
  25. var table = "<table class='table'>";
  26. $.each(data, function (index, value) {
  27.  
  28. table += "<tr><td>" + value.Model_ID + "</td></tr>";
  29. var latlng = new google.maps.LatLng(value.MapLat,
  30. value.MapLong);
  31.  
  32. var infowindow = new google.maps.InfoWindow();
  33. var service = new
  34. google.maps.places.PlacesService(map);
  35.  
  36. service.getDetails({
  37. }, function (place, status) {
  38. placeId: 'ChIJN1t_tDeuEmsRUsoyG83frY4'
  39. if (status ===
  40. google.maps.place.PlacesServiceStatus.OK) {
  41. var marker = new google.maps.Marker({
  42. position: latlng,
  43. icon: "../car-dealer.svg",
  44. animation: google.maps.Animation.DROP,
  45. map: map
  46. });
  47.  
  48. google.maps.event.addListener(marker,
  49. 'click', function () {
  50. infowindow.setContent('<div><strong>' +
  51. place.name + '</strong><br>' +
  52. place.formatted_address + '</div>');
  53. infowindow.open(map, this);
  54.  
  55. });
  56. }
  57.  
  58. });
  59.  
  60. gmarkers.push(marker);
  61. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement