templates/public/_listing_map.html.twig line 1

Open in your IDE?
  1. {% if lat_long is not empty %}
  2.     <div id="listing_map"></div>
  3.     {% set lstLatLng = lat_long | split(',') %}
  4.     <script>
  5.     function initMap(){
  6.         var lat_lng ={lat: {{ lstLatLng[0] }} , lng: {{ lstLatLng[1] }} };
  7.         var map = new google.maps.Map(document.getElementById('listing_map'), {zoom: 16, 
  8.                                                                     center: lat_lng
  9.                                                                     });
  10.         //marker
  11.         var marker = new google.maps.Marker({position: lat_lng, 
  12.                                             map: map, 
  13.                                             icon:'{{ app.request.getBaseURL() }}/public/img/map_marker.png'});  
  14.     }
  15.     </script>
  16. {% endif %}