/**
 * @package     SP Soccer
 * @author      JoomShaper http://www.joomshaper.com
 * @copyright   Copyright (C) 2010 - 2016 JoomShaper. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
 
jQuery(function($){
  $('.splms-event-map').each(function(e) {
    var self = $(this),
    parentId = self.attr('id'),
    mapId    = '#'+parentId+'';
    //console.log(parentId.attr('data-lat'));

    google.maps.event.addDomListener(window, 'load', function(){
      var latlng = new google.maps.LatLng(self.data('lat'), self.data('lng'));
      var mapOptions = {
        zoom: 14,
        center: latlng,
        scrollwheel: false
      };
      var map = new google.maps.Map(document.getElementById(parentId), mapOptions);
      var marker = new google.maps.Marker({position: latlng, map: map});
      map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
    });

  });
});
