Hi. This is a great module with a lot of promise.
One feature which i needed for my implementation, that I believe would be greatly beneficial to other users of the module is the ability to have customizable markers. The idea being that in a case such as search results, where you may have 10 items appear on the map, it would be cool if each result had a special marker, and thus you could locate them better on the map.
The attached patch will expose just this sort of functionality. The only difference between the base functionality and this is that the marker set up by Drupal.settings will be used if no special marker has been specified. When outputting the microformat snippet, if you add an icon element to the longitude/latitude elements, that icon will be used instead. Therefore, the snippet in the results could be written as:
<div class="geo">
<span class="latitude">40.760344</span>
<span class="longitude">-73.991274</span>
<span class="icon">http://localhost/imgs/imgs/r_marker_1.png</span>
</div>
The updated jquery (see patch) will then parse the variables and overwrite the default icon settings for that point.
The icon can then also be displayed next to the results on the theming side (not handled by this patch or this module).
* See the attached screenshot below.*
I'd like to hear your thoughts on this. If you like the idea, and would like assistance getting this into the module, let me know.
| Comment | File | Size | Author |
|---|---|---|---|
| custom_marker.patch | 1.71 KB | socki | |
| screenshot | 69.6 KB | socki |
Comments
Comment #1
voxpelli commentedIt's an interesting and good idea!
Can the javascript perhaps be made pluggable? I know that Simple Geo isn't really pluggable right now but I image that the icon could be defined in a lot of different ways. In a list you wouldn't need to add an icon showing the position to the markup - you could specify it in js and choose it based on position in the list. For other stuff you perhaps would like to upload it through a CCK field. Yet another possibility would be to select an icon based on taxonomy terms.
If Simple Geo could be made to ask for an icon instead of trying to find it themselves it would be possible to satisfy all situations without having to code them from all into Simple Geo core and without any conflicts.
Perhaps add an array like simplegeo.iconLookup to which all lookup functions can be added? Loop through them and send all necessary data to the lookup function - stopping as soon as an icon is found and then use that icon?