I successfully have OpenLayers showing node locations on my Drupal 6 install. Now I am trying to recreate my website in D7 and I cannot seem to get locations to work.

I have tried the location modeule, geocode, etc and nothing actually shows the points on my openlayers map. When I change the view to to a table I can see node data including lat/long but as soon as I switch it to open layers all I see is a blank map.

Comments

elly’s picture

I am having the same issue in d7 - I have the mapbox map working but no points. There doesn't seem to be any way to specify which field to get location data from on the view yet.

I'd be happy to help write up some docs if someone would be willing to give me rough walkthrough on how to create a map view using d7 & openlayers. We could go over it on IRC and I'd just transcribe and edit something for the README.txt if it would help. Lemme know.

j0k3z’s picture

Well your issue may be different. I have specified to get data from lat/long fields which do have data but the points are not showing up at all.

elly’s picture

How did you specify which fields to get data from? My open layers view has no "fields" option. Using views 3.

bjalford’s picture

Just done a clean install with latest dev versions of modules and can get the map with maker on nodes but not in a view. If you have got this working please share!

j0k3z’s picture

No, its not working for me

j0k3z’s picture

Works fine when using GMap, does not work when using OpenLayers

zzolo’s picture

Category: bug » support

What input mechanism are people using here? Location, custom fields, Geofield, etc?

j0k3z’s picture

I am using the Location module, enter in a street address which is then automatically geocoded

zzolo’s picture

@j0k3z, last time I checked, Location did not expose the lat/lon in a format in Views that OpenLayers could use. Not sure if that is still the case or not. In a the Data Overlay views preview, you should be able to see what data is coming through.

j0k3z’s picture

@zzolo, thanks for the support

I am using latitude / longitute fields that hold the correct data. The overlay preview shows the following data for those fields, does it look incorrect?

'latitude_rendered' => '41° 53\' 9.69" N',
'latitude' => '41° 53\' 9.69" N',
'longitude_rendered' => '87° 38\' 3.2712" W',
'longitude' => '87° 38\' 3.2712" W',

zzolo’s picture

Yeah, OpenLayers can only handle decimal values for lat and lon. I would suggest putting in an issue for Location to offer more formatters for that field. (or build your own). We won't put that in this module, as the scope of this module is display, not data.

j0k3z’s picture

ok, I switched the output to decimal, I didnt realize that was needed. Its still not showing the points on the map though. The data overlay now shows this:

'latitude_rendered' => '41.876714',
'latitude' => '41.876714',
'longitude_rendered' => '-87.634028',
'longitude' => '-87.634028',

j0k3z’s picture

When I go into the Openlayers Settings, and 'edit' my custom map, and turn on "Bars: - OpenLayers Data Overlay" under overlay layers, then it successfully shows my data embedded into the map, but not as clickable points

zzolo’s picture

You'll have to enable the OpenLayers popup behavior in the Maps definition.

j0k3z’s picture

Thanks! I was able to get that to work. Tooltips dont seem to work though, they disappear before you can move your mouse onto them

bjalford’s picture

I'm trying to get it to work by using a geofield field. I start with a list view which has a node with a geofield (POINT decimal). I then swap to openlayers default map and update the default map with Geofield behaviours...but I'm still not seeing any points on the map. Any ideas?

sksmithson’s picture

Same as #15 - I'm at the point where I can see the map with a marker. I've enabled the pop up but it disappears before I can click on the link.

I'm using D7 and created custom fields for latitude and longtitude.

sksmithson’s picture

Correction - if I disable the tootip, the pop up opens when the marker is clicked and the link works fine.

j0k3z’s picture

Not nearly as smoothly as the 6x version though...

Not much luck with OpenLayers + tooltips either as the show up under my map

zzolo’s picture

tooltips and popups dont really work together well.

elly’s picture

I am using addressfield and then converting the data there using geofield and the 'geocode from another field' input formatty. I have the lat & long in my view, but no points on my map :( When I change my view to use 'openlayers' style (rather than list, grid, etc), I lose all 'fields' options in the views interface. But when I switch to list view, I can see the lat & long of the nodes clearly being printed in decimal format...

j0k3z’s picture

Elly: your issue isnt really related to mine. You probably havent yet added a "data overlay" view type to your view, but I have and I am still having issues.

elly’s picture

Thanks for the hint!

j0k3z’s picture

Status: Active » Closed (fixed)
claudiuenache’s picture

Sorry to post on a closed issues, but this is the most relevant post I found.

Under the Display Format there is no Openlayers Data Overlay option to choose from. On the other hand, OpenLayers Map option appears.
My guess is that I am using wrong combination of Views-OpenLayers modules version.
I have tried different combinations, and none of them worked.
http://istos.it/blog/mapping/openlayers-and-addressfieldis says especially "7. Under the Display Format make sure to choose Openlayers Data Overlay"
Am I on the wrong track?

Thanks a bunch!

claudiuenache’s picture

Status: Closed (fixed) » Active
Thomas_M’s picture

Make sure that on the "page" tap you selected "Open Layer Map" and on the "Open Layer Data Overlay" tap you selected "Open Layer Data Overlay". To be able to do so, you have to make sure, that the style option for the Overlay data are set to "This openlayers (overwrite)".

For me the view works if I only add the WKT field and not the title and description field.

Good luck

elly’s picture

j0k3z was right, I missed the step where you have to add a map overlay display to the view. Is working now!

DjebbZ’s picture

Status: Active » Closed (fixed)

I followed istos tutorial, and I tried with my own settings. All the stack necessary to produce map is working as much as they can to date (OpenLayers, Geocode, Geofield, Addressfield + Views and Ctools). So most the errors reported above are either misconfigured Views and/or Maps, or geocoding problems (if you use geocode). I think we should close this issue.