Hey everyone Im trying to do a services area page with google maps but I cant get more then 10 on the limits
{% component source: "Service Areas"
, limit: "10"
, object: "collection"
, collectionVariable: "serviceAreas"
, type: "module" %}
<div class="container mx-auto my-8">
<div
id="map"
class="w-full bg-gray-300 rounded-xl"
style="height: 1200px;"></div>
</div>
<script>
var serviceAreas = [
{% for item in serviceAreas.items %}
{
name: "{{ item.name }}",
postcode: "{{ item.postcode }}",
placeId: "{{ item.placeID }}",
lat: {{ item.Coordinateslatitude }},
lng: {{ item.Coordinateslongitude }}
},
{% endfor %}
];
function initMap() {
var mapStyles = [
{
featureType: "poi",
elementType: "labels",
stylers: [{ visibility: "off" }]
},
{
featureType: "poi.business",
stylers: [{ visibility: "off" }]
},
{
featureType: "road",
elementType: "labels.icon",
stylers: [{ visibility: "off" }]
}
];
// Initial map setup with styles
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 12,
center: { lat: -26.785616, lng: 153.057947 },
styles: mapStyles
});
// Add markers for each service area
serviceAreas.forEach(function(area) {
var marker = new google.maps.Marker({
position: { lat: area.lat, lng: area.lng },
map: map,
title: area.name,
icon: '/assets/icons/map-marker-radius.png'
});
// Optionally, add info window for each marker
// var infowindow = new google.maps.InfoWindow({
// content: '<h3>' + area.name + '</h3><p>' + area.postcode + '</p>'
// });
// marker.addListener('click', function() {
// infowindow.open(map, marker);
// });
});
}
</script>
<script
src="https://maps.googleapis.com/maps/api/js?key=APIKEY&callback=initMap"
async
defer></script>