arnaucube
arnaucube/commonroutesLandingPagePublic Self-hosted repository
commonroutesLandingPage/js/grayscale.js
js/grayscale.jsRaw
  1/*!
  2 * Start Bootstrap - Grayscale Bootstrap Theme (http://startbootstrap.com)
  3 * Code licensed under the Apache License v2.0.
  4 * For details, see http://www.apache.org/licenses/LICENSE-2.0.
  5 */
  6
  7// jQuery to collapse the navbar on scroll
  8function collapseNavbar() {
  9    if ($(".navbar").offset().top > 50) {
 10        $(".navbar-fixed-top").addClass("top-nav-collapse");
 11    } else {
 12        $(".navbar-fixed-top").removeClass("top-nav-collapse");
 13    }
 14}
 15
 16$(window).scroll(collapseNavbar);
 17$(document).ready(collapseNavbar);
 18
 19// jQuery for page scrolling feature - requires jQuery Easing plugin
 20$(function() {
 21    $('a.page-scroll').bind('click', function(event) {
 22        var $anchor = $(this);
 23        $('html, body').stop().animate({
 24            scrollTop: $($anchor.attr('href')).offset().top
 25        }, 1500, 'easeInOutExpo');
 26        event.preventDefault();
 27    });
 28});
 29
 30// Closes the Responsive Menu on Menu Item Click
 31$('.navbar-collapse ul li a').click(function() {
 32    $(".navbar-collapse").collapse('hide');
 33});
 34
 35function init() {
 36    // Basic options for a simple Google Map
 37    // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions
 38    var mapOptions = {
 39        // How zoomed in you want the map to start at (always required)
 40        zoom: 15,
 41
 42        // The latitude and longitude to center the map (always required)
 43        center: new google.maps.LatLng(40.6700, -73.9400), // New York
 44
 45        // Disables the default Google Maps UI components
 46        disableDefaultUI: true,
 47        scrollwheel: false,
 48        draggable: false,
 49
 50        // How you would like to style the map.
 51        // This is where you would paste any style found on Snazzy Maps.
 52        styles: [{
 53            "featureType": "water",
 54            "elementType": "geometry",
 55            "stylers": [{
 56                "color": "#000000"
 57            }, {
 58                "lightness": 17
 59            }]
 60        }, {
 61            "featureType": "landscape",
 62            "elementType": "geometry",
 63            "stylers": [{
 64                "color": "#000000"
 65            }, {
 66                "lightness": 20
 67            }]
 68        }, {
 69            "featureType": "road.highway",
 70            "elementType": "geometry.fill",
 71            "stylers": [{
 72                "color": "#000000"
 73            }, {
 74                "lightness": 17
 75            }]
 76        }, {
 77            "featureType": "road.highway",
 78            "elementType": "geometry.stroke",
 79            "stylers": [{
 80                "color": "#000000"
 81            }, {
 82                "lightness": 29
 83            }, {
 84                "weight": 0.2
 85            }]
 86        }, {
 87            "featureType": "road.arterial",
 88            "elementType": "geometry",
 89            "stylers": [{
 90                "color": "#000000"
 91            }, {
 92                "lightness": 18
 93            }]
 94        }, {
 95            "featureType": "road.local",
 96            "elementType": "geometry",
 97            "stylers": [{
 98                "color": "#000000"
 99            }, {
100                "lightness": 16
101            }]
102        }, {
103            "featureType": "poi",
104            "elementType": "geometry",
105            "stylers": [{
106                "color": "#000000"
107            }, {
108                "lightness": 21
109            }]
110        }, {
111            "elementType": "labels.text.stroke",
112            "stylers": [{
113                "visibility": "on"
114            }, {
115                "color": "#000000"
116            }, {
117                "lightness": 16
118            }]
119        }, {
120            "elementType": "labels.text.fill",
121            "stylers": [{
122                "saturation": 36
123            }, {
124                "color": "#000000"
125            }, {
126                "lightness": 40
127            }]
128        }, {
129            "elementType": "labels.icon",
130            "stylers": [{
131                "visibility": "off"
132            }]
133        }, {
134            "featureType": "transit",
135            "elementType": "geometry",
136            "stylers": [{
137                "color": "#000000"
138            }, {
139                "lightness": 19
140            }]
141        }, {
142            "featureType": "administrative",
143            "elementType": "geometry.fill",
144            "stylers": [{
145                "color": "#000000"
146            }, {
147                "lightness": 20
148            }]
149        }, {
150            "featureType": "administrative",
151            "elementType": "geometry.stroke",
152            "stylers": [{
153                "color": "#000000"
154            }, {
155                "lightness": 17
156            }, {
157                "weight": 1.2
158            }]
159        }]
160    };
161
162    // Get the HTML DOM element that will contain your map
163    // We are using a div with id="map" seen below in the <body>
164    var mapElement = document.getElementById('map');
165
166    // Create the Google Map using out element and options defined above
167    map = new google.maps.Map(mapElement, mapOptions);
168
169    // Custom Map Marker Icon - Customize the map-marker.png file to customize your icon
170    var image = 'img/map-marker.png';
171    var myLatLng = new google.maps.LatLng(40.6700, -73.9400);
172    var beachMarker = new google.maps.Marker({
173        position: myLatLng,
174        map: map,
175        icon: image
176    });
177}