Skip to content

Commit bd0e1ca

Browse files
committed
Replaced Google Maps with working API Key and error free JavaScript. Removed all Browser Console Bugs - no errors anymore.
1 parent 4ca92d1 commit bd0e1ca

File tree

11 files changed

+114
-196
lines changed

11 files changed

+114
-196
lines changed

admin/inc/header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<div class="container">
5454
<div class="row">
5555
<div class="col-md-3 col-xs-5 logo">
56-
<a href="http://localhost/ecomphp/admin"><img src="https://via.placeholder.com/276x100" class="img-responsive" alt=""/></a>
56+
<a href="http://localhost/ecomphp/admin"><img src="<?php echo getenv('STORE_URL'); ?>/assets/images/logo.png" class="img-responsive" alt=""/></a>
5757
</div>
5858
<div class="col-md-9 col-xs-7">
5959
<div class="top-bar">

admin/login.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
<div class="container">
9595
<div class="row">
9696
<div class="col-md-3 col-xs-5 col-md-offset-4 logo">
97-
<a href="<?php echo getenv('STORE_URL'); ?>/admin/"><img src="https://via.placeholder.com/276x100" class="img-responsive" alt=""/></a>
97+
<a href="<?php echo getenv('STORE_URL'); ?>/admin/"><img src="<?php echo getenv('STORE_URL'); ?>/assets/images/logo.png" class="img-responsive" alt=""/></a>
9898
</div>
9999
</div>
100100
</div>

assets/images/favicon.png

4.85 KB
Loading

assets/images/logo.png

4.88 KB
Loading

assets/js/gmap.js

Lines changed: 95 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,95 @@
1-
// GOOGLEMAP
2-
google.maps.event.addDomListener(window, 'load', init);
3-
4-
function init() {
5-
var mapOptions = {
6-
zoom: 11,
7-
center: new google.maps.LatLng(40.6700, -73.9400), // New York
8-
styles: [{
9-
"featureType": "landscape",
10-
"stylers": [{
11-
"saturation": -100
12-
}, {
13-
"lightness": 65
14-
}, {
15-
"visibility": "on"
16-
}]
17-
}, {
18-
"featureType": "poi",
19-
"stylers": [{
20-
"saturation": -100
21-
}, {
22-
"lightness": 51
23-
}, {
24-
"visibility": "simplified"
25-
}]
26-
}, {
27-
"featureType": "road.highway",
28-
"stylers": [{
29-
"saturation": -100
30-
}, {
31-
"visibility": "simplified"
32-
}]
33-
}, {
34-
"featureType": "road.arterial",
35-
"stylers": [{
36-
"saturation": -100
37-
}, {
38-
"lightness": 30
39-
}, {
40-
"visibility": "on"
41-
}]
42-
}, {
43-
"featureType": "road.local",
44-
"stylers": [{
45-
"saturation": -100
46-
}, {
47-
"lightness": 40
48-
}, {
49-
"visibility": "on"
50-
}]
51-
}, {
52-
"featureType": "transit",
53-
"stylers": [{
54-
"saturation": -100
55-
}, {
56-
"visibility": "simplified"
57-
}]
58-
}, {
59-
"featureType": "administrative.province",
60-
"stylers": [{
61-
"visibility": "off"
62-
}]
63-
}, {
64-
"featureType": "water",
65-
"elementType": "labels",
66-
"stylers": [{
67-
"visibility": "on"
68-
}, {
69-
"lightness": -25
70-
}, {
71-
"saturation": -100
72-
}]
73-
}, {
74-
"featureType": "water",
75-
"elementType": "geometry",
76-
"stylers": [{
77-
"hue": "#ffff00"
78-
}, {
79-
"lightness": -25
80-
}, {
81-
"saturation": -97
82-
}]
83-
}]
84-
};
85-
86-
var mapElement = document.getElementById('map');
87-
88-
var map = new google.maps.Map(mapElement, mapOptions);
89-
90-
var marker = new google.maps.Marker({
91-
position: new google.maps.LatLng(40.6700, -73.9400),
92-
map: map,
93-
title: 'Snazzy!'
94-
});
95-
}
1+
// GOOGLEMAP
2+
// google.maps.event.addDomListener(window, 'load', init);
3+
4+
function initMap() {
5+
var latLong = new google.maps.LatLng(-33.918861, 18.423300);
6+
var mapOptions = {
7+
zoom: 11,
8+
center: latLong,
9+
styles: [{
10+
"featureType": "landscape",
11+
"stylers": [{
12+
"saturation": -100
13+
}, {
14+
"lightness": 65
15+
}, {
16+
"visibility": "on"
17+
}]
18+
}, {
19+
"featureType": "poi",
20+
"stylers": [{
21+
"saturation": -100
22+
}, {
23+
"lightness": 51
24+
}, {
25+
"visibility": "simplified"
26+
}]
27+
}, {
28+
"featureType": "road.highway",
29+
"stylers": [{
30+
"saturation": -100
31+
}, {
32+
"visibility": "simplified"
33+
}]
34+
}, {
35+
"featureType": "road.arterial",
36+
"stylers": [{
37+
"saturation": -100
38+
}, {
39+
"lightness": 30
40+
}, {
41+
"visibility": "on"
42+
}]
43+
}, {
44+
"featureType": "road.local",
45+
"stylers": [{
46+
"saturation": -100
47+
}, {
48+
"lightness": 40
49+
}, {
50+
"visibility": "on"
51+
}]
52+
}, {
53+
"featureType": "transit",
54+
"stylers": [{
55+
"saturation": -100
56+
}, {
57+
"visibility": "simplified"
58+
}]
59+
}, {
60+
"featureType": "administrative.province",
61+
"stylers": [{
62+
"visibility": "off"
63+
}]
64+
}, {
65+
"featureType": "water",
66+
"elementType": "labels",
67+
"stylers": [{
68+
"visibility": "on"
69+
}, {
70+
"lightness": -25
71+
}, {
72+
"saturation": -100
73+
}]
74+
}, {
75+
"featureType": "water",
76+
"elementType": "geometry",
77+
"stylers": [{
78+
"hue": "#ffff00"
79+
}, {
80+
"lightness": -25
81+
}, {
82+
"saturation": -97
83+
}]
84+
}]
85+
};
86+
87+
var mapElement = document.getElementById('map-pop');
88+
var map = new google.maps.Map(mapElement, mapOptions);
89+
90+
var marker = new google.maps.Marker({
91+
position: latLong,
92+
map: map,
93+
title: '22 Digital'
94+
});
95+
}

assets/js/gmap2.js

Lines changed: 0 additions & 95 deletions
This file was deleted.

config/.env.default

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ export STORE_CURRENCY='$'
4242
# export DB_PASSWORD=''
4343
# export DB_DATABASE='ecomphp'
4444

45+
# Google Maps API Key
46+
#####################
47+
# You will need to register your own API Key for the Google Maps integration.
48+
# You can do so by registering your key here:
49+
# https://developers.google.com/maps/documentation/javascript/get-api-key
50+
export GOOGLE_MAPS_API_KEY=''
51+
4552
# Social Media Profiles
4653
#######################
4754
# NB: Only add your username in the values below. The URLs are already set up in

config/.env.prod

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ export STORE_CURRENCY='$'
4242
# export DB_PASSWORD=''
4343
# export DB_DATABASE='ecomphp'
4444

45+
# Google Maps API Key
46+
#####################
47+
# You will need to register your own API Key for the Google Maps integration.
48+
# You can do so by registering your key here:
49+
# https://developers.google.com/maps/documentation/javascript/get-api-key
50+
export GOOGLE_MAPS_API_KEY=''
51+
4552
# Social Media Profiles
4653
#######################
4754
# NB: Only add your username in the values below. The URLs are already set up in

inc/footer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
</div>
8585
</footer>
8686
<!-- FOOTER -->
87+
<div id="map-pop"></div>
8788
</div>
8889

8990
<!-- Javascript -->
@@ -109,8 +110,7 @@
109110
<script src="<?php echo getenv('STORE_URL'); ?>/assets/js/jquery.prettyphoto.js"></script>
110111
<script src="<?php echo getenv('STORE_URL'); ?>/assets/js/script.js"></script>
111112
<script src="<?php echo getenv('STORE_URL'); ?>/assets/js/booking.js"></script>
112-
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
113+
<script async defer src="https://maps.googleapis.com/maps/api/js?key=<?php echo getenv('GOOGLE_MAPS_API_KEY', null); ?>&v=quarterly&callback=initMap" type="text/javascript"></script>
113114
<script src="<?php echo getenv('STORE_URL'); ?>/assets/js/gmap.js"></script>
114-
<script src="<?php echo getenv('STORE_URL'); ?>/assets/js/gmap2.js"></script>
115115
</body>
116116
</html>

inc/header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<div class="row">
4444
<div class="col-md-3 col-xs-5 logo">
4545
<a href="<?php echo getenv('STORE_URL'); ?>/index.php">
46-
<img src="https://via.placeholder.com/276x100" class="img-responsive" alt=""/>
46+
<img src="<?php echo getenv('STORE_URL'); ?>/assets/images/logo.png" class="img-responsive" alt=""/>
4747
</a>
4848
</div>
4949
<div class="col-md-9 col-xs-7">

0 commit comments

Comments
 (0)