!! Updated !!
I'm having a little trouble getting my google map to display correctly, and I'm getting this error in the console log. I have tried adjusting the prefix as listed by the examples here. I feel however I'm still not understanding this correctly. Could anyone explain this in laymans terms for me?
1 - Prefixed Fullscreen API is deprecated. Please use unprefixed API for fullscreen. For more help https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API
This is where I believe the errornous code is;
// Google Map Element
var mapElement = document.getElementById('map');
// I added thes lines to try and solve the prefix error.
if (mapElement.requestFullscreen) {
mapElement.requestFullscreen();
}
EDIT :
Okay so a little trouble has turned into a couple of days of trial and error. I have tried a number of different things to try and get around this issue, but I don't think im saavy enough to undertand what's going wrong.
Just to update my error log;
1 - TypeError: google is undefined p-apollo:32:5
2 - Prefixed Fullscreen API is deprecated. Please use unprefixed API for fullscreen. For more help https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API controls.js:23:54
3 - "Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error" js:32:350
4 - "Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys" util.js:222:12
5 - "Google Maps API warning: SensorNotRequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required" util.js:222:12
Note : I have generated and included an API key from google, however as I'm running locally; I have commented this out and added the following in it's place. I tried adding a release verion of the API as mentioned in another answer.
<!-- Google Maps API -->
<script language="javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true&v=3"></script>
Full Code Chunk
Just to cover all the bases I have added the code chunk i have in place for my google map. If some one could please scan through it and make sure I haven't made a noob error, I would appreciate it, sometimes a second set of eyes is the solution.
<!-- Google Maps Script -->
<script type="text/javascript">
// create google map on doc load
google.maps.event.addDomListener(window, 'load', init);
function init() {
var mapOptions = {
zoom: 11,
// The latitude and longitude to center the map (always required)
center: new google.maps.LatLng(40.6700, -73.9400),
styles: [{
"featureType": "landscape",
"stylers": [{
"hue": "#FFBB00"
}, {
"saturation": 43.400000000000006
}, {
"lightness": 37.599999999999994
}, {
"gamma": 1
}]
}, {
"featureType": "road.highway",
"stylers": [{
"hue": "#FFC200"
}, {
"saturation": -61.8
}, {
"lightness": 45.599999999999994
}, {
"gamma": 1
}]
}, {
"featureType": "road.arterial",
"stylers": [{
"hue": "#FF0300"
}, {
"saturation": -100
}, {
"lightness": 51.19999999999999
}, {
"gamma": 1
}]
}, {
"featureType": "road.local",
"stylers": [{
"hue": "#FF0300"
}, {
"saturation": -100
}, {
"lightness": 52
}, {
"gamma": 1
}]
}, {
"featureType": "water",
"stylers": [{
"hue": "#0078FF"
}, {
"saturation": -13.200000000000003
}, {
"lightness": 2.4000000000000057
}, {
"gamma": 1
}]
}, {
"featureType": "poi",
"stylers": [{
"hue": "#00FF6A"
}, {
"saturation": -1.0989010989011234
}, {
"lightness": 11.200000000000017
}, {
"gamma": 1
}]
}]
};
// Google Map Element
var mapElement = document.getElementById('map');
if (mapElement.requestFullscreen) {
mapElement.requestFullscreen();
}
var map = new google.maps.Map(mapElement, mapOptions);
// Map Marker
var marker = new google.maps.Marker({
position: new google.maps.LatLng(40.6700, -73.9400),
map: map,
title: 'title'
});
}
</script>
Tested In : - Firefox 47.0 - Chrome 51.0.2704.103