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

RdeBoer’s picture

Probably 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".

nicxvan’s picture

Interesting, 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.

RdeBoer’s picture

You have a point!

RdeBoer’s picture

Status: Active » Closed (won't fix)

You 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.

RdeBoer’s picture

Title: Enabling Leaflet removes custom pins from the list of markers » Allow multiple marker image directories to pick and choose from
Assigned: Unassigned » RdeBoer
Status: Closed (won't fix) » Postponed

I'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.

gge’s picture

I 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.

RdeBoer’s picture

One 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

JohnColeman’s picture

Different 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. :-)

vchen’s picture

It 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.

mstrelan’s picture

Do 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().