Allow other modules to define markers

Created on 24 December 2009, almost 15 years ago
Updated 16 February 2023, almost 2 years ago

Currently other modules can't define markers, but with the attached simple patch they can.

We add a new hook: hook_gmap_markerfiles_info() that returns an array from file_scan_directory of marker files. Simple.

✨ Feature request
Status

Needs work

Version

2.12

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom steven jones

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States markabur

    I tried using this feature to add a new marker set using a custom module. I used a debugger to verify that the custom marker .ini is being read and that the icons are available in $icons at the end of _gmap_get_icondata(). However, the custom custom marker set is not showing up in Views. I'm looking at the "Marker / fallback marker to use" popup and don't see my marker set listed there.

    Here is my .ini file. It is called "mynumbers.ini":

    ; Defaults
    [defaults]
    ; Note: An empty shadow property will break IE.
    ; Leave it commented out if you aren't supplying an image.
    ;shadow = ""
    anchorX = 10
    anchorY = 29
    infoX = 17
    infoY = 6
    
    ; Marker sets
    [mynumbers]
    name = "My Numbers"
    sequence = "mynumber1.png,mynumber2.png,mynumber3.png,mynumber4.png,mynumber5.png,mynumber6.png,mynumber7.png,mynumber8.png,mynumber9.png,mynumber10.png,mynumber11.png,mynumber12.png,mynumber13.png,mynumber14.png,mynumber15.png,mynumber16.png,mynumber17.png,mynumber18.png,mynumber19.png,mynumber20.png"
    
    ; Files
    

    I've also tried leaving it as numbers.ini and naming the icons like number1.png, etc. but my custom icons don't override the default Numbers icon set (using Views to generate the map).

Production build 0.71.5 2024