Skip to content

Instantly share code, notes, and snippets.

@henrytran9x
Created September 25, 2015 10:22
Show Gist options
  • Save henrytran9x/45ed665aaf47c55796ce to your computer and use it in GitHub Desktop.
Save henrytran9x/45ed665aaf47c55796ce to your computer and use it in GitHub Desktop.
Contact customize
<style>
.site-contact-wrapper{
background-color: #eff1f5;
}
</style>
<div class="contact-map">
<div id="map"></div>
</div>
<div id="content-wrapper" class="site-contact-wrapper">
<div class="container">
<div class="row">
<div class="col-md-6 col-left-side contact-detail"></div>
<div class="col-md-6 col-right-side contact-form-wrapper">
<?php print $contact; ?>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var text_map = '<?php echo str_replace(array("\n", "\r"), '', $text_map);?>'
var locations = [[text_map,<?php echo $map_lat ?>, <?php echo $map_long ?>, 2]];
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 14,
scrollwheel: false,
navigationControl: true,
mapTypeControl: false,
scaleControl: false,
draggable: true,
<?php if($style_map) :?>
styles: <?php echo $style_map; ?>,
<?php endif; ?>
center: new google.maps.LatLng(<?php echo $map_lat; ?>, <?php echo $map_long; ?>),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var infowindow = new google.maps.InfoWindow();
var marker, i;
<?php if($maker_map) :?>
var icon_map = {
url: "<?php echo $maker_map ?>", // url
scaledSize: new google.maps.Size(50, 50), // scaled size
origin: new google.maps.Point(0,0), // origin
anchor: new google.maps.Point(0, 0) // anchor
};
<?php endif; ?>
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
animation: google.maps.Animation.DROP,
map: map ,
icon: icon_map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
if (marker.getAnimation() != null) {
marker.setAnimation(null);
} else {
marker.setAnimation(google.maps.Animation.BOUNCE);
}
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
(function($){
$(document).ready(function() {
$('.page-contact #section-main-content .dexp-container .alert').wrap('<div class="container"></div>');
});
}(jQuery));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment