I'm not sure if this is an OpenLayers issue or a Geofield issue.
I've created a content type that has a title, a body and a geofield (post_location). The geofield data is being properly captured and can be displayed on the node itself in WKT. I've created a view with an OpenLayers Data Overlay display. In the settings for the OpenLayers Data Overlay format I've set the Map Data Sources field to WKT, but then I try to set the WKT Field to my post_location field, it isn't listed - only the node title is listed. I've attached a screenshot.
Using OpenLayers 7.x-2.x-dev and Geofield 7.x-1.x-dev, as of today, May 3.
Comment | File | Size | Author |
---|---|---|---|
openlayers-geofield.png | 79.12 KB | add1sun |
Comments
Comment #1
zzolo CreditAttribution: zzolo commentedHey @add1sun. Sorry for the delay. Not sure if you did this yet, but you have to add your Geofield to the list of fields in Views. Make sure you format it as WKT (which is the default). Then you'll have that as a choice for the data source. Basically the Data Overlay settings just pull what fields have been add to the view.
Hope that helps.
Comment #2
add1sun CreditAttribution: add1sun commentedAha! OK, that got my Geofield as the WKT Field, but the view is getting NULL for the value, even though I know there is a value since it displays on the node itself.
On the node view with formatter set to WKT I see:
Post location: POINT (12.52196211 55.6606232146)
In the view preview:
Comment #3
zzolo CreditAttribution: zzolo commentedHmmm. That's odd. Maybe you need the Geofield dev version?
Comment #4
zzolo CreditAttribution: zzolo commentedHi @add1sun. Did you figure this out? Re-open if needed.
Comment #5
cospace CreditAttribution: cospace commentedHi, @zzolo I have similar issue here bugging me a few days, I read through all the posts and videos and couldnt find any clue, can you help me out?
Drupal and openlayer, geofield version I use are all 7+versions.
What I did was:
1. add content field, field type ->geofield, widget type ->openlayers map (coz I wanna users can mark their location when creating content)
2. Create views and add openlayers data overlay, at the data source part, there are only three options which is lat/log value, WKT, boundary box ==> how can I select the geofield I just created? even I put WKT in step 1, the data source options dont have WKT field showing.
Attached a few screenshots to check.
million thanks.
Comment #6
cospace CreditAttribution: cospace commentedI found this is due to didnt add location field in the views, thanks.