But does it? I've got to store some geodata in a format to allow me to to easily stick it on a OpenLayers map. I can't seen any reason why it won't work, but haven't seen any documentation yet on how to do it either.

Comments

phayes’s picture

Yes it should (note that I haven't tested!). In your OpenLayers data view select the latitude and longitude columns from geolocation field.

If you are working with a lot of geodata, you may also want to check out the geofield module (http://drupal.org/project/geofield), which has support for lines, polygons and compound geometries.

mgifford’s picture

Thanks @phayes - we're experimenting with Geofield too. Is there a simple comparison between the Geofield module & Geolocation field? Seem similar.

phayes’s picture

Geofield supports points, lines, polygons, and collections. Also appears to be better supported: more installs, stable release, more active maintainers and more supporting modules. Geolocation has a nicer widget and provides pre-computed fields that help with proximity filter querying in the database.

Disclaimer: I'm a maintainer of geofield and am therefore heavily biased.

mgifford’s picture

Thanks @phayes.. Maybe the geolocation widget can be brought over to geolocation at some point.

Hopefully also we get a heavily biased description from the geolocation folks. That way we might be able to see if there's room for collaboration if not merging projects.

phayes’s picture

Definitely into collaboration. One regrettable thing is that geolocation got started a few months before geofield, then I posted geofield without even knowing geolocation existed. It would be nice to see them come together in some way.

wemmies’s picture

Please look at this thread http://drupal.org/node/1129512, a more elaborate discussion about a merger of the two projects.

To your initial question:
Yes it works and I have tested.
I only use the google map widget to store the data in field_location and then in views add that field_location twice to the fiels section. One field with Formatter set to Lattitude text based-formatter and one to longtitude text based-formatter

Then at your format settings of the Openlayers data overlay format set the first one to lattitude and the second one to longtitude.

This works for me.

mgifford’s picture

Thanks

cluther’s picture

Following up on @phayes earlier recommendation with details on using "Geolocation Field" with OpenLayers instead of GeoField. I discovered that in order to get Geolocation Field to minimally work I needed to:

  1. Add the content type's Geolocation Field twice to the Overlay View, the first formatted as Latitude data and the second formatted as Longitude data. (Image A).
  2. Then I selected Views Format: Settings and under OpenLayers Data Overlay: Style Options I configured Map Data Sources for Lat/Lon Pair and Latitude Field and Longitude Field to reference their respective fields. (Image B).

I was never able to get WKT to work.

Image A
Image A

Image B
Image A

michel zin’s picture

Hello phayes,

How can i show google map with several pinponts from different location?
Supposing users will find and pinpoint their respective locations of same city on Google map in creation of content.
I'd like to create view/page that have google map that show all pinpoints of above.

Really sorry if my question is out of scope for this post.

kind regards,
michel zin

rdeboer’s picture

Geolocation Field already interfaces with OpenLayers (and Leaflet and Google Maps) via http://drupal.org/project/ip_geoloc.
Check the special OpenLayers section in the README of the module: http://drupalcode.org/project/ip_geoloc.git/blob_plain/refs/heads/7.x-1....

christianadamski’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Closing all 7.x issues. It's time.