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.

Comments

steven jones’s picture

StatusFileSize
new2.07 KB

Of course we need to update the titles function too...

steven jones’s picture

Status: Needs review » Needs work

Ah nuts, the marker dir is hardcoded in there, the code is not smart at all!

steven jones’s picture

Status: Needs work » Needs review
StatusFileSize
new3 KB

Ah okay, if we store everything relative to the drupal root, then we're laughing!

manarth’s picture

It would also be useful for THEMES to be able to provide custom markers (and/or override the presentation of the markers/content defined by modules).

podarok’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Needs work

all feature requests can be imported in 6.x version after committing em in major versions with backport afterwards
Can You make this ?

anpolimus’s picture

Assigned: Unassigned » anpolimus
Issue summary: View changes
Issue tags: +dcuacs2015
anpolimus’s picture

StatusFileSize
new1.66 KB
anpolimus’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
anpolimus’s picture

Status: Needs work » Active
anpolimus’s picture

Status: Active » Needs work
anpolimus’s picture

anpolimus’s picture

podarok’s picture

Status: Needs work » Needs review

bot up

The last submitted patch, gmap-hook_gmap_markerfiles.patch, failed testing.

The last submitted patch, 1: gmap-hook_gmap_markerfiles.patch, failed testing.

The last submitted patch, 3: gmap-hook_gmap_markerfiles.patch, failed testing.

The last submitted patch, 7: patch-10298331.patch, failed testing.

valentine94’s picture

Looks good to me, +1 to RTBC

podarok’s picture

Status: Needs review » Needs work
Issue tags: +CodeSprintUA
+++ b/gmap_markerinfo.inc
@@ -9,6 +9,34 @@
+  $markercustomdir = variable_get('gmap_marker_custom_dir', NULL);

Let's make default variable value looking at system tmp path

paravibe’s picture

Assigned: anpolimus » Unassigned
Status: Needs work » Reviewed & tested by the community

Looks good.

paravibe’s picture

Status: Reviewed & tested by the community » Needs work

Oops, didn't see previous comment.
@anpolimus will you do this?

anpolimus’s picture

Sure, will do.

anpolimus’s picture

I have deleted this variable at all, because new custom dir and markerfiles could be now added with hook, defined in this task.
@podarok, @paravibe please approve that this is suitable resolution in this case.

anpolimus’s picture

Status: Needs work » Needs review
anpolimus’s picture

Assigned: Unassigned » anpolimus
podarok’s picture

Status: Needs review » Fixed

Thanks @anpolimus, #23 committed.

  • podarok committed 0a65c76 on 7.x-2.x authored by anpolimus
    Issue #667272 by anpolimus, Steven Jones, podarok: Allow other modules...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Ives’s picture

Variable gmap_marker_custom_dir is removed, but still available to set in settings form (gmap_settings_ui.inc).
How can we now define a custom marker folder without using the hook?

jsst’s picture

Version: 7.x-2.x-dev » 7.x-2.11
Status: Closed (fixed) » Needs work

This issue is not properly fixed and is breaking existing installs. I believe the following should be done:

- make the change backwards compatible so we don't break things between minor version changes (that's important!)
- and when we remove gmap_marker_custom_dir, clean up the settings as mentioned in #29
- document how the new hook works, users now have to reverse-engineer gmap_gmap_markerfiles_info()

Regarding the backwards compatibility, maybe gmap could not delete gmap_marker_custom_dir and implement a default markerfiles_info hook that reads the variable and uses that directory if it's set.

vkechagias’s picture

Priority: Normal » Major

Since this is breaking functionality of the custom markers configured through the gmap settings this should be escalated to Major Priority.

On https://www.drupal.org/node/2692971 there seems to be a workaround to make custom markers work again after updating to 7.x-2.11 however this should be fixed properly.

markabur’s picture

Version: 7.x-2.11 » 7.x-2.12

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