In Views Settings now there is description_field , name_field (which i dont understand what it does) etc.
It would be useful to also have leaflet_id field so u can add node_id field.
My use case is moving over List of Nodes show associated marker on map

thx.

Comments

int_ua’s picture

Assigned: Unassigned » int_ua
Issue summary: View changes

I need the same feature. Trying to implement it.

int_ua’s picture

Status: Active » Needs review
StatusFileSize
new1.72 KB

I've added the field and it works as expected. I was expecting Leaflet would add the id to markers. But I cannot even find it in docs at http://leafletjs.com/reference.html
How do we use it?

joachim’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.72 KB

Patch works great.

Here's a reroll from the root of the project folder. I'm going to mark this RTBC, since I've not made any code changes to the patch.

> I was expecting Leaflet would add the id to markers.

They don't seem to get added to the HTML in any way -- I was expecting them to show up in CSS classes, as perhasp you were too.

However, this JS code shows that the markers in the map are indexed by the ID field:

console.log(Drupal.settings.leaflet[0].lMap._layers)

(where 0 is the number of the map on the page.)

rdeboer’s picture

@nbchip:

The feature you talk about is known as "cross-highlighting" and is available out of the box and without you doing any programming in IPGV&M, http://drupal.org/project/ip_geoloc.

You can also see it in live action here: http://regionbound.com/coffee-prices-across-melbourne

Enable IPGV&M but also keep Leaflet and your current View enabled. Then for the current View format select "Map (Leaflet API, via IPGV&M)" rather than "Leaflet Map" and you'll see a configuration panel with lots of features not available in Leaflet-by-itself, including your cross-highlighting.

Rik

jenlampton’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.77 KB

The patch didn't apply cleanly for me to the 7.x-1.x-dev branch. Rerolled.