Advertisement
Guest User

EM override single map

a guest
May 8th, 2012
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. function em_maps() {
  2. jQuery('.em-location-map').each( function(index){
  3. el = jQuery(this);
  4. var map_id = el.attr('id').replace('em-location-map-','');
  5. em_LatLng = new google.maps.LatLng( jQuery('#em-location-map-coords-'+map_id+' .lat').text(), jQuery('#em-location-map-coords-'+map_id+' .lng').text());
  6. maps[map_id] = new google.maps.Map( document.getElementById('em-location-map-'+map_id), {
  7. zoom: 8,
  8. center: em_LatLng,
  9. mapTypeId: google.maps.MapTypeId.ROADMAP,
  10. mapTypeControl: false
  11. });
  12. var marker = new google.maps.Marker({
  13. position: em_LatLng,
  14. map: maps[map_id]
  15. });
  16. maps[map_id].panBy(0,0);
  17. });
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement