I’m setting up Custom Modules so that my client can add multiple locations to a google map. I’ve set-up name, address, tel, email. I’ve also added the Longitude and Latitude within Custom Modules rather than in the Settings/Site Information as in the Lawyers website.
I’m using the code (map.inc in includes) from the example Lawyer websites with Google Maps.
To get multiple address I’ve changed:
{% for item in map.items -%}
{% if forloop.last == true -%}
[’{{map.items[0].Name}}’, +’{{map.items[0].LocationLat}}’, +’{{map.items[0].LocationLng}}’]
{% else -%}
[’{{map.items[0].Name}}’, +’{{map.items[0].LocationLat}}’, +’{{map.items[0].LocationLng}}’],
{% endif -%}
{% endfor -%}
];
…to…
{% for item in map.items -%}
{% if forloop.last== true -%}
[’{{map.items[0].Name}}’, +’{{map.items[0].LocationLat}}’, +’{{map.items[0].LocationLng}}’],
[’{{map.items[1].Name}}’, +’{{map.items[1].LocationLat}}’, +’{{map.items[1].LocationLng}}’],
[’{{map.items[2].Name}}’, +’{{map.items[2].LocationLat}}’, +’{{map.items[2].LocationLng}}’],
[’{{map.items[3].Name}}’, +’{{map.items[3].LocationLat}}’, +’{{map.items[3].LocationLng}}’],
[’{{map.items[4].Name}}’, +’{{map.items[4].LocationLat}}’, +’{{map.items[4].LocationLng}}’],
[’{{map.items[5].Name}}’, +’{{map.items[5].LocationLat}}’, +’{{map.items[5].LocationLng}}’],
[’{{map.items[6].Name}}’, +’{{map.items[6].LocationLat}}’, +’{{map.items[6].LocationLng}}’],
[’{{map.items[7].Name}}’, +’{{map.items[7].LocationLat}}’, +’{{map.items[7].LocationLng}}’],
[’{{map.items[8].Name}}’, +’{{map.items[8].LocationLat}}’, +’{{map.items[8].LocationLng}}’],
[’{{map.items[9].Name}}’, +’{{map.items[9].LocationLat}}’, +’{{map.items[9].LocationLng}}’],
[’{{map.items[10].Name}}’, +’{{map.items[10].LocationLat}}’, +’{{map.items[10].LocationLng}}’],
[’{{map.items[11].Name}}’, +’{{map.items[11].LocationLat}}’, +’{{map.items[11].LocationLng}}’],
[’{{map.items[12].Name}}’, +’{{map.items[12].LocationLat}}’, +’{{map.items[12].LocationLng}}’],
{% else -%}
{% endif -%}
{% endfor -%}
];
Unfortunately, I can only get a maximum of 10 Markers on the map which I think is being limited by Google Maps.
I know there are third-party options available but I’d like to try and keep the same format.
Is there a workaround or can anything be changed within map.inc?
Any help would be much appreciated.