City Google Maps

Google Maps with great styles. Flexible manager of maps and data, many options, easy to use.

Back to City Google Maps Support

rosarygaseous97532
rosarygaseous97532

Hi everyone,

I’m using the City GoogleMaps plugin and would like to display multiple location markers on the same map, each with a custom icon based on the city type (e.g., office, store, event). I’ve managed to get a single marker working, but I’m unsure how to:

Add multiple markers dynamically from my database,

Assign different icons to each marker,

Ensure markers open custom popups with city details when clicked.

Has anyone implemented this before? Any code snippets or configuration examples for the component would be really helpful!

Thanks in advance!

City
City

Hello,

If you need to add markers dynamically from your own database tables or with an API, you can follow the City Dynamic Maps docs (https://octobercms.com/plugin/city-map):

Custom source

This method is more flexible but requires programming skills. Need to create a PHP class and implement the City\Map\Classes\Source\Custom\SourceInterface interface. The trait City\Map\Classes\Source\Custom\SourceBehavior can be used as the helper. You can check how it works with the sample class City\Map\Classes\Source\Sample\Places

Regards

1-2 of 2