|
Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /var/www/kokohpondasi.co.id/public_html/theme/js/ |
Upload File : |
/* --------------------------------------------
Google Map
-------------------------------------------- */
window.onload = MapLoadScript;
function GmapInit() {
Gmap = $('.map-canvas');
Gmap.each(function() {
var $this = $(this),
lat = '',
lng = '',
zoom = 12,
scrollwheel = false,
zoomcontrol = true,
draggable = true,
mapType = google.maps.MapTypeId.ROADMAP,
title = '',
contentString = '',
dataLat = $this.data('lat'),
dataLng = $this.data('lng'),
dataZoom = $this.data('zoom'),
dataType = $this.data('type'),
dataScrollwheel = $this.data('scrollwheel'),
dataZoomcontrol = $this.data('zoomcontrol'),
dataHue = $this.data('hue'),
dataTitle = $this.data('title'),
dataContent = $this.data('content');
if( dataZoom !== undefined && dataZoom !== false ) {
zoom = parseFloat(dataZoom);
}
if( dataLat !== undefined && dataLat !== false ) {
lat = parseFloat(dataLat);
}
if( dataLng !== undefined && dataLng !== false ) {
lng = parseFloat(dataLng);
}
if( dataScrollwheel !== undefined && dataScrollwheel !== null ) {
scrollwheel = dataScrollwheel;
}
if( dataZoomcontrol !== undefined && dataZoomcontrol !== null ) {
zoomcontrol = dataZoomcontrol;
}
if( dataType !== undefined && dataType !== false ) {
if( dataType == 'satellite' ) {
mapType = google.maps.MapTypeId.SATELLITE;
} else if( dataType == 'hybrid' ) {
mapType = google.maps.MapTypeId.HYBRID;
} else if( dataType == 'terrain' ) {
mapType = google.maps.MapTypeId.TERRAIN;
}
}
if( dataTitle !== undefined && dataTitle !== false ) {
title = dataTitle;
}
if( navigator.userAgent.match(/iPad|iPhone|Android/i) ) {
draggable = false;
}
var mapOptions = {
zoom : zoom,
scrollwheel : scrollwheel,
zoomControl : zoomcontrol,
draggable : draggable,
center : new google.maps.LatLng(lat, lng),
mapTypeId : mapType
};
var map = new google.maps.Map($this[0], mapOptions);
var image = 'images/icons/map-marker.png';
if( dataContent !== undefined && dataContent !== false ) {
contentString = '<div class="map-data">' + '<h6>' + title + '</h6>' + '<div class="map-content">' + dataContent + '</div>' + '</div>';
}
var infowindow = new google.maps.InfoWindow({
content: contentString
});
var marker = new google.maps.Marker({
position : new google.maps.LatLng(lat, lng),
map : map,
icon : image,
title : title
});
if( dataContent !== undefined && dataContent !== false ) {
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
}
if( dataHue !== undefined && dataHue !== false ) {
var styles = [
{
"featureType": "administrative",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#272727"
}
]
},
{
"featureType": "landscape",
"elementType": "all",
"stylers": [
{
"color": "#f1efe9"
}
]
},
{
"featureType": "poi",
"elementType": "all",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "road",
"elementType": "all",
"stylers": [
{
"saturation": -20
},
{
"lightness": 20
}
]
},
{
"featureType": "road.highway",
"elementType": "all",
"stylers": [
{
"visibility": "off"
},
{
"color": "#fc721e"
}
]
},
{
"featureType": "road.arterial",
"elementType": "labels.icon",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "transit",
"elementType": "all",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "water",
"elementType": "all",
"stylers": [
{
"color": "#a5c6fd"
},
{
"visibility": "on"
}
]
}
];
map.setOptions({styles: styles});
}
});
}
function MapLoadScript() {
var script = document.createElement('script');
script.type = 'text/javascript';
GmapInit();
document.body.appendChild(script);
}