Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Adding a custom pin to the markers folder allows switching of the pins on a google map, then enabling leaflet removes the pins from the list.
Comments
Comment #1
RdeBoerProbably because the default marker image directory for Google is
.../markers
and the default directory for Leaflet is.../amarkers
.You can set (or reset) this at admin/config/system/ip_geoloc, opening the first fieldset "Alternative Markers".
Comment #2
nicxvan CreditAttribution: nicxvan commentedInteresting, so adding the pins to the amarkers folder worked. But on both the google map and leaflet, so it seem that if leaflet is enabled it uses the amarkers folder whether you are rendering with google or leaflet.
Comment #3
RdeBoerYou have a point!
Comment #4
RdeBoerYou can of course dump all the markers in one folder, somewhere on your system, some for use by Google and some for Leaflet, but they'll all have to be the same dimensions.
Comment #5
RdeBoerI'm changing my mind on this one. Maybe we should have multiple folders for multiple maps.
If more people ask for this feature I'll consider it for version 7.x-1.28.
Am keen to get 7.x-1.27 out the door first.
Comment #6
gge CreditAttribution: gge commentedI think different sizes for markers will be a great addition to IPGV&M!
Right now we can achieve this by setting the canvas of the PNG file bigger than the actual draw, but this method have some side effects like for example unwanted space between markers and popups.
Comment #7
RdeBoerOne complication with implementing this comes with the recent new features like "cross-highlighting".
We can't do calculations using variable input in CSS. So the positioning of the "bigger marker" and its popup balloon are currently based on the one base size we have for Leaflet.
In order to do this properly we need to introduce JS to do the CSS adjustments based on the marker size input of the "Alternative markers" fieldset on the IPGV&M global configuration page.
Not really hard. But quite a bit of fiddling nonetheless.
Rik
Comment #8
JohnColeman CreditAttribution: JohnColeman as a volunteer commentedDifferent sizes for markers would definitely be a great addition to IPGV&M!
Multiple folders for multiple maps would be good, or just multiple sets of alternate markers, each with its own directory and size - shared by all maps. admin/config/system/ip_geoloc could allow addition of new alternate marker sets.
The 'setting the canvas of the PNG file bigger than the actual draw' workaround is sub-optimal because the mouseover text appears in the wrong place etc.
Great work though, keep it up. :-)
Comment #9
vchen CreditAttribution: vchen commentedIt would be great if in the configuration screen you can allow users to point to a new directory of markers outside the module. Every time there's an upgrade, I wipe out my custom icons.
Comment #10
mstrelan CreditAttribution: mstrelan commentedDo we need to open a separate ticket for custom sizes? I've had a look at this and it seems there are at least two changes required.
1. ip_geoloc_output_map_multi_location() needs to output the marker width/height/anchor where it outputs the color/location.
2. Drupal.behaviors.addGMapMultiLocation needs to reference individual marker width/height/anchor properties within the loop
for (var key in locations) { }
With those two changes we can add the dimensions to each marker via hook_ip_geoloc_marker_locations_alter().