I'm not sure whether this is an Openlayers or Geofield question.
I have a content type with two map based fields
trail - geofield - Openlayers map
start_points - geofield - Openlayers map
They both use separate input maps, both maps are set to 'Geofield - Fuels the geofield map-input form'.
I want to display all information on one map, which I've done, using a view.
My problem is at node level. Trails and start points for ALL nodes are shown on a node level map. And even that is ok, except I want to make it obvious which trail and start points belong to the selected node, so I've used styles as follows.
Placeholder for geofield formatter - style - highlighted
Start point view - style - dimmed
Trail view - style - dimmed
That works, except only the start point data is highlighted, so the geofield formatter holds the start point data and not the trail data too.
I'm guessing that's because both my input maps are based on 'Geofield - Fuels the geofield map-input form' the start points override the trails as the start points is the second map?
I could clone the Placeholder for Geofield Formatter but I can't see how I could get the trail input map to use it?
Any help gratefully received, thanks.
Comments
Contextual Filter for node level
Set a contextual filter on your view to only display info related to current node. Then only that info will show on your map. Unless you want everything on there with only the current ones highlighted then you might be able to create two different views one showing only the current nodes info and another with everything else. Then it should be easier to manage classes.
Hope that helps.
Use "differentiator" function in IP Geolocation Views & Maps
The module IPGV&M, http://drupal.org/project/ip_geoloc has the concept of a "differentiator" that may help too.
IPGV&M supports Geofield and you can select and switch between any of the Big Three map providers: Google, OpenLayers and Leaflet. So you won't have to change your setup much.
The idea is to create a View (with a Page and/or Block display) that initially shows all your nodes.
The differentiator is typically a field like "Degree of difficulty" or "Length" that you can use to colour code your markers by the values of that field.
But you can also use a contextual filter argument, i.e. URL argument, as a differentiator.
To use it for your site, select "Content: Nid" as the Differentiator, then enter "!1" for the differentiator value and select a colour.
No need to create a contextual filter.
Works for Views with Page displays as well as Views with Block displays.
So you can put your View Block on "node/*" pages and then when you view say node/422 the map will show with all its markers, but with one differently coloured and that's the one for node 422. Then when you visit node/455, it will be the marker belonging to node 455 that is different.
Reading the original post again, there may be one snag: IPGV&M only supports one lat/lon pair per node per map. So you may have to resort to 2 different maps, one for trails and one for starting points?
Either way, worth exploring. May give you some new ideas.
Thanks to all, I'll take a
Thanks to all, I'll take a look.