I'm just starting out with OpenLayers and I've been fiddeling with the Getting Started With OpenLayers-tutorial. I get everything to work except the orange pin (or circle) doesn't seem to respond to my Longitude-value. In the node generating the point I've entered long: 11.9479 and lat: 57.6997 which should translate to the western coast of Sweden but instead puts the point in the middle of Russia. The latitude-value (the horizontal one) seems correct, but the longitude value is way off. Further, the pin won't move when I alter the value in the node so it would seem that something isn't processed the way it should be.

My setup:
Drupal 6-2.0
OpenLayers 6.x-2.0-alpha10
CTools 6.x-1.8
Views 6.x-2.12
CCK 6.x-2.9

I've looked through the javascript being outputted on the page in question, and found this:

"field_longitude_value":"11.9479",
"field_longitude_value_rendered":"12"

I haven't figured out exactly what this does, but rounding off the longitude-value would seem to me would render the spot in the wrong place?

It's worth noting that I've centered the map on the location I mentioned in the beginning of this post and that works well; it's just the position of the pin itself that is off. See the attached image for my Open Layers Data View-settings.

UPDATE:
Viewing the ?q=testing-page (where the map is being rendered) in Firefox or Chrome causes an CCK-error:

Fatal error: Cannot access empty property in drupalroot/sites/all/modules/cck/includes/views/handlers/content_handler_field.inc on line 186 
CommentFileSizeAuthor
dump.png107.64 KBepavletic

Comments

epavletic’s picture

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

Drama,

Did you close this issue because you resolved the issue? Can you share your actions to resolve?

I too have been testing out OpenLayers and have run into the same problems.
1) The points on the map seem to be in the wrong location
2) Am getting a similar fatal error

Thanks for any input you can provide.

Mike

tmcw’s picture

mike234: I'd assume that Drama closed the issue because the screenshot clearly shows both latitude and longitude being set to latitude.

mike234’s picture

tmcw,

Thanks for note. I had the same latitude/longitude issue and missed it when I reviewed the screen shot.

Also, I was able to track down the reason for the fatal error (Fatal error: Cannot access empty property in ...../sites/all/modules/cck/includes/views/handlers/content_handler_field.inc on line 186). I did not have permissions set correctly. Once I provided all roles permission to the latitude and longitude fields everything works fine.

Thanks again for the pointer and a big thank you to the OpenLayers team. What a fantastic module!

Mike

rajmataj’s picture

After building a mapping portion of my site from this tutorial, I wasn't using the Lat/Long settings but instead was using the WKT widget to allow a user to plot a point on a map, but was seeing this error. I am using:

  • Drupal 6.25
  • CCK 6.x-2.9
  • OpenLayers 6.x-2.0-beta1
  • OpenLayers Geocoder 6.x-2.0-alpha5
  • Views 6.x-2.16

If you are seeing this, it is likely a permissions issue on a particular field but check these three things:

  1. In Views, besides the WKT field being called in, I also was calling on the title and wanted to show an uploaded image users submitted on the node which represents the marker. The title is part of the node and doesn't need permissions set, but the WKT geofield and in my case the image field both needed permissions set to allow particular roles to view them. Without having these set, the page did not load and resulted in the .../sites/all/modules/cck/includes/views/handlers/content_handler_field.inc on line 186 error. Once I set the permissions (on the Permissions page, not within Views) to allow particular roles to view these fields, the pages with my map on them rendered without any issues.
  2. In Views, on your OpenLayers Data display, click the gear icon under Basic Settings > Style and experiment with the checked/unchecked Keep non-rendered description field attribute. option.
  3. I found that on a local copy of the same website, the error didn't occur. On the live site, it only showed on 'www' versions of the webpage(s) in question but the non 'www' pages were fine. I adjusted the .htaccess to forward to the non 'www' version. You should choose one or the other for SEO purposes anyhow