Skip to content

Instantly share code, notes, and snippets.

@Venugopal155
Created November 29, 2016 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Venugopal155/b7404e5b450f0d420728368028c748de to your computer and use it in GitHub Desktop.
Save Venugopal155/b7404e5b450f0d420728368028c748de to your computer and use it in GitHub Desktop.
<?php
/*
* Template Name: Location Template
*
*
* Description: In this page displays the location page information , most dynamic data
* coming from dashboard
*
* @author : Venugopal
* @category: Location page
* @package : Parallel
*/
get_header();
/* Getting here ACF for location page section */
$address_details_on_map = get_field('address_details_on_map');
$parl_areial_map = get_field('parl_areial_map');
$heading_of__content_section = get_field('heading_of__content_section');
$parl_enter_content = get_field('parl_enter_content');
$location_map_code = get_field('location_map_code');
$parl_heading_of_content = get_field('parl_heading_of_content');
$parl_content_sectio = get_field('parl_content_sectio');
$location_gallery = get_field('location_gallery');
/* Geting from address latitude and longitude */
$address = get_field('home_google_map_address',5);
$prepAddr = str_replace(' ','+',$address);
$geocode=file_get_contents('https://maps.google.com/maps/api/geocode/json?address='.$prepAddr.'&sensor=false');
$output= json_decode($geocode);
$latitude = $output->results[0]->geometry->location->lat;
$longitude = $output->results[0]->geometry->location->lng;
/* Getting Map marker details */
$home_map_marker_details = get_field('home_map_marker_details',5);
?>
<!-- Passing hidden fields to map js -->
<input type ="hidden" id="c_map_latitude" value="<?php echo $latitude;?>">
<input type ="hidden" id="c_map_longitude" value="<?php echo $longitude; ?>">
<input type ="hidden" id="c_map_map_marker_details" value="<?php echo $home_map_marker_details; ?>">
<input type ="hidden" id="c_map_prepAddr" value="<?php echo $prepAddr; ?>">
<div class = "row thumbnail-main-row">
<div class = "col-md-2 zoom-main-col-1 pc-view">
<div class = "row zoom-row-1">
<?php //if (isset($_REQUEST['amap'])) {?>
<div class = "col-md-12 zoom-col-1 location-map-zoom-col-1">
<h6>ZOOM</h6>
</div>
<?php // } ?>
</div>
<div class = "row">
<?php //if (isset($_REQUEST['amap'])) {?>
<div class = "col-md-12 zoom-in-col">
<input class = "btn zoom-in-btn" type="button" value="" onclick="zoomIn()"/>
</div>
<?php // } ?>
</div>
<div class = "row">
<?php //if (isset($_REQUEST['amap'])) {?>
<div class = "col-md-12 zoom-in-col">
<input class = "btn zoom-out-btn" type="button" value="" onclick="zoomOut()"/>
</div>
<?php //} ?>
</div>
</div>
<div class = "col-md-7 location-map-head-col-1">
<?php if (isset($_REQUEST['amap']) || empty($_REQUEST['lmap'])) {?>
<h1 class = "location-map-head">
<?php echo $address_details_on_map; ?>
</h1>
<?php } ?>
</div>
<div class = "col-md-3">
<div class = "row thumbnail-img-row <?php if (isset($_REQUEST['lmap'])) { ?> on_location_map <?php } ?>">
<div class = "<?php if (isset($_REQUEST['lmap'])) {?> map_active <?php } ?> col-xs-6 col-sm-6 col-md-6 thumbnail-img-col thm-1">
<h5 class = "thumbnail-heading"> Location Map </h5>
<a href = "<?php echo site_url();?>/location/?lmap=location_map" class="location_map_show"><img src = "<?php bloginfo("template_url"); ?>/images/map-thumbnaail.png"></a>
</div>
<div class = " <?php if (isset($_REQUEST['amap']) || empty($_REQUEST['lmap'])) {?> map_active <?php } ?>col-xs-6 col-sm-6 col-md-6 thumbnail-img-col thm-2">
<h5 class = "thumbnail-heading">Areial Map </h5>
<a href = "<?php echo site_url();?>/location/?amap=areial" class="areial_map_show"><img src = "<?php bloginfo("template_url"); ?>/images/location-thumbnail.png"></a>
</div>
</div>
</div>
<div class = "row mobile-zoom mobile-view">
<div class = "mobile-zoom-wrapper1">
<div class = "col-xs-6 col-sm-6 plus">
<input class = "btn zoom-in-btn1" type="button" value="" onclick="zoomIn()"/>
</div>
<div class = "col-xs-6 col-sm-6 minus">
<input class = "btn zoom-out-btn1" type="button" value="" onclick="zoomOut()"/>
</div>
</div>
</div>
</div>
<div class = "row location-map-row">
<div class = "col-md-12 location-map-col <?php if (isset($_REQUEST['lmap'])) {?> row-location-map <?php } ?>">
<?php if (isset($_REQUEST['amap']) || empty($_REQUEST['lmap'])) {?>
<div class="pinch-zoom-container">
<div class="areal-click-map ">
<div id="pcontainer111" class="pancontainer11">
<img id="pinch-zoom-image-id" class="pinch-zoom-image" onload="onLoad()" src="<?php bloginfo('template_url');?>/images/location-areial-mobile.jpeg">
</div>
</div>
</div>
<?php }
if (isset($_REQUEST['lmap'])) {?>
<div class="pinch-zoom-container">
<div class="areal-click-map ">
<div id="pcontainer111" class="pancontainer11">
<img id="pinch-zoom-image-id" class="pinch-zoom-image" onload="onLoad()" src="<?php bloginfo('template_url');?>/images/location-map-mobile.jpeg"">
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<div class = "row stunning-row loc-second-row">
<div class = "col-md-2"></div>
<div class = "col-md-8 stunning-head-col location-head">
<div class = "ccdd">
<div class = "stunning-border-col"></div>
<h1 class = "stunning-head loc-head">
<?php echo $heading_of__content_section; ?>
</h1>
<div class = "stunning-border-col bottom"></div>
</div>
<?php echo $parl_enter_content;?>
<div class = "col-md-2"></div>
</div>
</div>
<div class = "row map-img-row">
<div class = "col-md-12 map-img-col map-col-location location-mid-map">
<!-- <img src = "<?php bloginfo("template_url"); ?>/images/Location-Map.jpg"> -->
<?php echo do_shortcode($location_map_code);?>
</div>
</div>
<div class = "row stunning-row loc-second-row">
<div class = "col-md-2"></div>
<div class = "col-md-8 stunning-head-col location-head">
<div class = "ccdd">
<div class = "stunning-border-col"></div>
<h1 class = "stunning-head">
<?php echo $parl_heading_of_content; ?>
</h1>
<div class = "stunning-border-col bottom"></div>
</div>
<?php echo $parl_content_sectio;?>
<div class = "col-md-2"></div>
</div>
</div>
<div class = "row gallery-row">
<div class = "col-md-12 gallery-col">
<?php echo do_shortcode($location_gallery);?>
</div>
</div>
<style>
.pinch-zoom-container {
overflow: hidden;
height: auto;
}
.pinch-zoom-image {
width: 100%;
}
.pinch-zoom-image:hover {
cursor: pointer;
}
</style>
<script src="https://hammerjs.github.io/dist/hammer.js"></script>
<script src="<?php bloginfo('template_url');?>/js/newzoom.js"></script>
<?php get_footer();?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment