I'm working on building a template, and need some help. Here's the use case:

We have an event, that contains a node reference to a venue. If the user doesn't select the venue, the user has to input a location, using the openlayers_geocoder. That works great. Well, in the event display, we wanted to display the map for the location (if no venue was selected), but display the map for the venue if they selected the venue.

I'm working in a custom template for the event content type, and have it loading the node for the venue. However, I can't figure out how to actually render the map from the location field. All I have is the WTK (?) format, and can't figure out how to get the map from there. Any thoughts on how to do this? I'm not too familiar with the cck API, but if that's where I need to go, just let me know!

Thanks in advance!

Comments

zzolo’s picture

Hey @mikesir87 , thanks for the interest. Currently there is no documented, straight-forward way to do this. What you will need to do is look at how the CCK module is creating its formatters which is pretty much what you want to do. Get a preset, then add a behavior to it that will add features.

This issue is still open (as I have not had time to get to it) that is aiming at addressing this problem.
#734702: Make Vector layer generic

tmcw’s picture

Er, it's really best to piggyback on either the CCK Map widget or, better, a Views Attachment. Dig through the node array contents and you just might find a rendered map, if you're using the cck map formatter.

(for reference, try building node displays with views and views attachments - it's a much more sustainable solution)

tmcw’s picture

Any luck? Anything else needed here?

tmcw’s picture

Status: Active » Closed (duplicate)

Setting as duplicate on the assumption that this is basically about the generic vector layer.