Socialify

Folder ..

Viewing index.html
153 lines (147 loc) • 7.6 KB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>BackSlash Maps</title>
        <link rel="stylesheet" href="index.css">
        <script src='https://api.mapbox.com/mapbox-gl-js/v0.47.0/mapbox-gl.js'></script>
        <link href='https://api.mapbox.com/mapbox-gl-js/v0.47.0/mapbox-gl.css' rel='stylesheet' />
        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
        <script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v2.3.0/mapbox-gl-geocoder.min.js'></script>
        <link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v2.3.0/mapbox-gl-geocoder.css' type="text/css">
        <script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-directions/v3.1.3/mapbox-gl-directions.js'></script>
        <link rel='stylesheet' href='directions.css' type='text/css' />
        
	</head>
	<body>
        <div id='map' style='width: 100vw; height: 100vh'></div>
        <div id='geocoder' class='geocoder'></div>

        <div id="hamburger"><i id="ham" class="fas fa-bars"></i></div>
        <div id="sidebar">
            <p id="SettingsLabel">Settings</p>
            <div id="settings">
            <p class="label">Maps Style</p>
            <div id='menu'>
                <input class="frm-maptoggle" id='streets' type='radio' name='rtoggle' value='streets' checked='checked'>
                <label for='streets'>Streets</label><br><br>
                <input class="frm-maptoggle" id='basic' type='radio' name='rtoggle' value='basic'>
                <label for='basic'>Basic</label><br><br>
                <input class="frm-maptoggle" id='bright' type='radio' name='rtoggle' value='bright'>
                <label for='bright'>Bright</label><br><br>
                <input class="frm-maptoggle" id='light' type='radio' name='rtoggle' value='light'>
                <label for='light'>Light</label><br><br>
                <input class="frm-maptoggle" id='dark' type='radio' name='rtoggle' value='dark'>
                <label for='dark'>Dark</label><br><br>
                <input class="frm-maptoggle" id='satellite' type='radio' name='rtoggle' value='satellite'>
                <label for='satellite'>Satellite</label><br><br>
            </div>
            <p class="label">Interactions</p>
            <nav id='listing-group' class='listing-group'>
                    <input type='checkbox' id='scrollZoom' checked='checked'>
                    <label for='scrollZoom'>Scroll zoom</label>
                    <input type='checkbox' id='boxZoom' checked='checked'>
                    <label for='boxZoom'>Box zoom</label>
                    <input type='checkbox' id='dragRotate' checked='checked'>
                    <label for='dragRotate'>Drag rotate</label>
                    <input type='checkbox' id='dragPan' checked='checked'>
                    <label for='dragPan'>Drag pan</label>
                    <input type='checkbox' id='keyboard' checked='checked'>
                    <label for='keyboard'>Keyboard</label>
                    <input type='checkbox' id='doubleClickZoom' checked='checked'>
                    <label for='doubleClickZoom'>Double click zoom</label>
                    <input type='checkbox' id='touchZoomRotate' checked='checked'>
                    <label for='touchZoomRotate'>Touch zoom rotate</label>
            </nav>
            <p class="label">About</p>
            <p class="ab-label"><strong>BackSlash Maps</strong></p>
            <p class="ab-label"><strong>Software Version: </strong>1.0.0</p>
            <p class="ab-label"><strong>GL JS Version: </strong>0.47.0</p>
            <p class="ab-label"><strong>Geocoder Version: </strong>2.3.0</p>
            <p class="ab-label"><strong>Directions Version: </strong>3.1.3</p>
            <p class="ab-label"><strong>RTL Text Plugin Version: </strong>0.2.0</p>
            </div>
        </div>
        <div id="copyright-notice">
            <p>&copy; Copyright 2018, BackSlash Linux LLC. <strong>BackSlash Maps</strong> powered by <i>Mapbox</i></p>
        </div>
        <script>
            mapboxgl.accessToken = 'pk.eyJ1IjoibHVjaWZlcmNyIiwiYSI6ImNqbDBxNnlxZTEzdHkzcG53NW9wNnpibjYifQ.owEb-xS1Y0B-bJYh9racYA';
            mapboxgl.setRTLTextPlugin('https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.0/mapbox-gl-rtl-text.js');
            var map = new mapboxgl.Map({
                container: 'map',
                style: 'mapbox://styles/mapbox/streets-v9',
                zoom: 2,
            });
            map.addControl(new MapboxDirections({
                accessToken: mapboxgl.accessToken
            }), 'bottom-left');
            var geocoder = new MapboxGeocoder({
                accessToken: mapboxgl.accessToken
            });

            document.getElementById('geocoder').appendChild(geocoder.onAdd(map));
            // After the map style has loaded on the page, add a source layer and default
            // styling for a single point.
            map.on('load', function() {
                map.addSource('single-point', {
                    "type": "geojson",
                    "data": {
                        "type": "FeatureCollection",
                        "features": []
                    }
            });

            map.addLayer({
                "id": "point",
                "source": "single-point",
                "type": "circle",
                "paint": {
                    "circle-radius": 10,
                    "circle-color": "#007cbf"
                }
            });

            // Listen for the `result` event from the MapboxGeocoder that is triggered when a user
            // makes a selection and add a symbol that matches the result.
            geocoder.on('result', function(ev) {
                map.getSource('single-point').setData(ev.result.geometry);
            });
            });
            map.addControl(new mapboxgl.GeolocateControl({
                positionOptions: {
                    enableHighAccuracy: true
                },
                trackUserLocation: true
            }));
            map.addControl(new mapboxgl.NavigationControl());
            var layerList = document.getElementById('menu');
            var inputs = layerList.getElementsByTagName('input');

            function switchLayer(layer) {
                var layerId = layer.target.id;
                map.setStyle('mapbox://styles/mapbox/' + layerId + '-v9');
            }

            for (var i = 0; i < inputs.length; i++) {
                inputs[i].onclick = switchLayer;
            }
            document.getElementById('listing-group').addEventListener('change', function(e) {
                var handler = e.target.id;
                if (e.target.checked) {
                    map[handler].enable();
                } else {
                    map[handler].disable();
                }
            });
        </script>
        <script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
        <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
        <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
        <script>if (window.module) module = window.module;</script>
        <script>
            jQuery(document).ready(function(){
                jQuery("#hamburger").click(function(){
                    jQuery("#sidebar").toggle("slide");
                    jQuery('ham').toggleClass("fa-bars");
                    jQuery('ham').toggleClass("fa-arrow-left");
                });
            });
        </script>
        <script>
        </script>
	</body>
</html>