Closed (fixed)
Project:
Leaflet
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
1 Aug 2012 at 09:48 UTC
Updated:
10 Mar 2013 at 04:00 UTC
Jump to comment: Most recent file
Hi,
Thanks for this module. I'm using with great success but am having trouble with displaying alternatives to the standard blue markers.
I found the README very useful. I based my attempts to introduce new marker icons on this excerpt:
$features = array(
array(
'type' => 'point',
'lat' => 12.32,
'lon' => 123.45,
'icon' => array(
'iconUrl' => 'sites/default/files/mymarker.png'
),
'popup' => l($node->title, 'node/' . $node->nid),
'leaflet_id' => 'some unique ID'
),
....
);
However the 'icon'/'iconUrl' part isn't working for me.
Any ideas?
Rik
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | [Upgrade_to_LeafletJS_0.4.x]-[1707882].patch | 2.33 KB | rdeboer |
| #5 | leaflet.tgz | 8.81 KB | rdeboer |
Comments
Comment #1
rdeboerFixed it.
There's a typo in leaflet/leaflet.drupal.js
Line #168 (in "create_point") reads:
Should be:
Multiple marker colors based on a "differentiator" field in the View (eg. node type, taxonomy term, price category etc..) are used in this Leaflet map rendering module: IP Geolocation Views and Maps.
Comment #2
rdeboerThe Icon object has changed somewhat in Leaflet 0.4 (30 July 2012), so the setting of marker size, anchor, shadow and popup anchor don't work with the old leaflet.drupal.js code either, result in the introduced marker being, .... well, "off the mark".
Here is the entire create_point section as it should be. Note the extra ".options" level in the icon object.
Will look at generating a proper patch.
Rik
Comment #3
gmclelland commentedI ran into the same issue with custom markers.
Comment #4
rdeboer@gmclelland, #3:
So did the patch to
leaflet/leaflet.drupal.jsoutlined in #2 work for you?Just copy the code from #2 and paste over the "create_point" section in the lealfet.drupal.js file.
Rik
Comment #5
rdeboerPatch (against 7.x-1.x-dev) and complete deployable module.
Tested with both Leaflet JS 0.4.0 and Leaflet JS 0.4.4 (7 Aug 2012).
The included fix to allow multiple layers to be stacked on the same canvas is evident in the OpenPisteMap (http://openpistemap.org), available from the map dropdown when you enable the Leaflet More Maps module.
It has relief-shading layer and piste layers on top of the base earth layer.
Comment #6
chaseonthewebConfirmed working against the latest -dev tarball as well.
Comment #7
cossovich commentedYep, confirmed here too. I've got the patch running against the most recent commit to 7.x-1.x and it's all working.
Comment #8
pvhee commentedThanks for the patch, this is now committed! (and so is the example makefile).
I'll discuss with levelos to see whether we can roll out a new release with all these changes (including Views support).
Comment #9
rdeboerThis is great news!
I love Leaflet.
Comment #11
prezaeis commentedCan you please tell me what this patch will do exactly?
I am using the IP Geolocation Views module to display content types using the Leaflet map. Would this patch allow me to use my own custom Markers?
Thank you
Comment #12
rdeboerThis was all sorted a long time ago. No need to patch.
Just use the latest version of Leaflet and IP Geoloc.
And if you're brave enough to use IP Geoloc 7.x-1.x-dev, then you get the option to number or tag yourmarkers too!
You add your own set of markers on the IP Geoloc config page.
Rik
Comment #12.0
rdeboeradded quote to iconUrl