Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- var lgmap;
- function initialize() {
- // Get Lat,Lng
- var geo = new google.maps.Geocoder;
- var lat;
- var lng;
- var address = $("#latlng").text();
- geo.geocode({'address':address},function(results, status){
- if (status == google.maps.GeocoderStatus.OK) {
- lat = results[0].geometry.location.d;
- lng = results[0].geometry.location.e;
- latLng = new google.maps.LatLng(lat,lng);
- // Map Settings
- var mapOptions = {
- center: latLng,
- zoom: 15
- };
- var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); // Creates Map
- var lgmap = new google.maps.Map(document.getElementById("lgMap"), mapOptions); // Creates Map
- // Map Marker
- var marker = new google.maps.Marker({
- position: latLng,
- map: map,
- title:"European Auto Visalia"
- });
- var lgmarker = new google.maps.Marker({
- position: latLng,
- map: lgmap,
- title:"European Auto Visalia"
- });
- } else {
- alert("Geocode was not successful for the following reason: " + status);
- }
- });
- };
- // Expand Map On Click
- $("#expandmap").click(function() {
- $("#mapModal").foundation('reveal', 'open');
- $(document).on('opened', '[data-reveal]', function () { //Fired upon modal opened completion
- google.maps.event.trigger(lgmap, 'resize'); // Problem Seems To Be Here?
- });
- });
- google.maps.event.addDomListener(window, 'load', initialize);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement