Closed gdundee closed 4 years ago
Hi @gdundee,
This is correct, the way in which information windows work is that the map has a marker added, with hidden content stored in a var that is then loaded into the information window upon click. I don't really see why there would be a count of 3, unless the map is created with a marker, along with the two separate information windows.
Any chance you could share your JS from the page too,
@gdundee You shouldn't add both a marker and an information window. Just add the information window.
Try changing this...
Mapper::marker($device_coordinates[0], $device_coordinates[1], ['marker' => false])->informationWindow($device_coordinates[0],$device_coordinates[1], $content, ['marker' => false, 'icon' => '/magilla_template/icons/device.png']);
... into this:
Mapper::informationWindow($device_coordinates[0], $device_coordinates[1], $content, ['marker' => false, 'icon' => '/magilla_template/icons/device.png']);
My controller is at the bottom of this comment. For some reason when I add a informational window to a marker the informational window is being added to the total number of markers in the cluster. Currently I only have two markers on the map, the initial one created with Mapper::map and the second one created with Mapper::marker. Both of them have informational windows, and the cluster count is showing 3 instead of two. If I remove the informational window from the first coordinate created with Mapper::map, then the count stays the same, 3. If I remove the informational window from the second coordinate created with Mapper::marker, then the count goes down by one and the cluster now displays 2. I have been at this for a few hours, and I'm not sure how to fix it. I also tried replacing the cluster icon in the config/googlmapper.php file, but no icon shows at all if I change that icon from the default 'icon' => '//googlemaps.github.io/js-marker-clusterer/images/m' If it is possible to fix the cluster count, that would be awesome, if it is possible to replace the cluster icon to avoid fixing the count, that would also be great. Any help at all would be greatly appreciated.
Thanks, Gavin