I have integrated google maps into the couchcms demo so it can be altered in the couchcms admin side, for some reason it don't seem to be working
in the admin side I have added the lat and long info but the coding for the map is not showing on the front end, below is the coding I have
I checked inspect element and no errors are showing and cleared the browser cache but still the google map coding is not showing
Any ideas as I am stuck on this
in the admin side I have added the lat and long info but the coding for the map is not showing on the front end, below is the coding I have
- Code: Select all
<cms:template title='Contact Us' order='3'>
<cms:editable name='my_editable_lat' type='text'/>
<cms:editable name='my_editable_lng' type='text'/>
</cms:template>
<div id="map"></div>
<script>
// Initialize and add the map
function initMap() {
// The location of Uluru
//var uluru = {lat: 52.080880, lng: 0.432960};
var uluru = {lat: <cms:show my_editable_lat />, lng: <cms:show my_editable_lng />};
// The map, centered at Uluru
var map = new google.maps.Map(
document.getElementById('map'), {zoom: 16, center: uluru});
// The marker, positioned at Uluru
var marker = new google.maps.Marker({position: uluru, map: map});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=MYGOOGLEAPIKEY&callback=initMap">
</script>
I checked inspect element and no errors are showing and cleared the browser cache but still the google map coding is not showing
Any ideas as I am stuck on this