I updated from OpenLayers 7.x-2.0-beta7 to OpenLayers 7.x-2.0-beta11 and all my map markers disappeared on maps displayed using OpenLayers views. Maps using the Geofield Formatter still display the marker.

Here is what I have tried so far:

  • Rolling back to earlier versions. Markers display in beta7; they don't display in beta8, beta9, or beta11.
  • Changed the markers -- tried them all, none display in beta11.
  • Changed the theme to Bartik in case it was a theme issue; markers still don't display in beta11.
  • Cleared Drupal's cache and the browser cache numerous times.
  • Created a new OpenLayers Data Overlay view; markers still don't display in beta11.

I've read the release notes and checked the README.txt file and the files in the docs directory in 7.x-2.0-beta11 and don't see what could be causing the markers to display in beta7 and not in beta11. The README.txt file says it is "Current for 7.x-2.0-beta1" and "updated on 2012-08-24" so I'm not sure it's up to date for the current version. Many of the .txt files in the docs directory are labeled "Current for 6.x-2.x" so I'm not sure they are up to date with the current version, either.

I haven't found any other issues describing this problem in recent versions.

Here's what I'm using:

  • Base layer: Google Maps Normal
  • Overlay layer: OpenLayers Data Overlay view with:
    • Format: OpenLayers Vector Data Overlay
    • Settings:
      • Map Data Sources: WKT
      • WKT Field: Content: Geo (field_geo) (This gets Geocode from the Address field using Google Geocoder.)
  • Style: Marker Red
  • Drupal 7.32
  • Address Field 7.x-1.0-beta5
  • CTools 7.x-1.4
  • Geofield 7.x-2.3
  • Geocoder 7.x-1.2
  • GeoPHP 7.x-1.7
  • Libraries 7.x-2.2
  • OpenLayers 7.x-2.0-beta11
  • OpenLayers library at http://openlayers.org/api/2.13/OpenLayers.js
  • OpenLayers Views 7.x-2.0-beta11
  • Views 7.x-3.8

What else can I try or where else should I look to figure out why the markers won't display in 7.x-2.0-beta11?

Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AgentJay’s picture

I just upgraded to beta11 from beta9 and all of my maps stopped working completely. But then I switched the OL library from internal to external and everything seems fine again.

camhoward’s picture

Thanks, @AgentJay. I'm using the external library as well, version 2.13. I also tried versions 2.12, 2.11, and 2.10 with beta11 and the markers don't display with any of them. What version are you using?

Morasta’s picture

Same issue here with a setup very similar to what's described in the issue description. Switching between internal and external makes no difference.

skyredwang’s picture

Same issue ad same fix as #1

batje’s picture

We had this issue when running OpenLayers in a subfolder from root and/or using a drupal url in the ExternalGraphic field (one that does not start with a /). We had a custom style that pointed to

profiles/devtrac/modules/contrib/openlayers/themes/default_dark/markers/marker-black.png

Because some code in the file

includes/openlayers.render.inc

was removed, this drupal path was not prefixed with the subfolder.

This patch puts the code back (copies from beta9)

camhoward’s picture

Thanks, @batje. I'm glad your patch solved your issue and appreciate you sharing it in case it helps someone else!

I regret to report it does not solve my issue. Even when I use the OpenLayers default markers, rather than a custom style, they do not display in beta8, beta9, or beta11; the markers only display in OpenLayers beta7.

Since my original note, I've updated to Drupal 7.34, CTools 7.x-1.6, Address Field 7.x-1.0, and Views 7.x-3.10 but none of that has made a difference to this issue.

It's still a puzzle.

batje’s picture

@camhoward can you find (using firebug or view source in Chrome) where the icons do point to? And are you running your Drupal install in a subfolder of root? eg. http://localhost/mysite/index.php ?

camhoward’s picture

@batje -- Drupal is installed in the root, not a subfolder, so index.php is at a URL like http://sitename.org/index.php.

In OpenLayers beta7, the image for the markers points to "sitename.org/sites/all/modules/openlayers/themes/default_dark/img/marker-red.png" and the marker-red.png file is indeed at that location.

In OpenLayers beta11, the marker-red.png file exists in the same referenced location, but does not display.

I also found this major difference in the HTML code:

In OpenLayers beta7, I have:

<g id="OpenLayers_Layer_Vector_19_root" style="visibility: visible;" transform="translate(0,24.49978773195403)">
   <g id="OpenLayers_Layer_Vector_19_vroot">
      <image id="OpenLayers_Geometry_Point_83" cx="335.4730628746704" cy="9.354131040448806" r="1" preserveAspectRatio="none" x="325" y="-16" width="21" height="25" xlink:href="http://sitename.org/sites/all/modules/openlayers/themes/default_dark/img/marker-red.png" style="opacity: 1" fill="#000000" fill-opacity="1" stroke="#000000" stroke-opacity="1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
   </g>
<g id="OpenLayers_Layer_Vector_19_troot"></g>

I have only included one image element here, but the actual code includes one image element for each marker.

However, in OpenLayers beta11, I have:

<g id="OpenLayers_Layer_Vector_19_root" style="visibility: visible;" transform="">
   <g id="OpenLayers_Layer_Vector_19_vroot"/>
   <g id="OpenLayers_Layer_Vector_19_troot"/></g>

There are no image elements listed in beta11 and the "transform=" is empty in beta11 while beta7 includes "translate(0,24.49978773195403)" for "transform" in the first line of code shown for each.

Could it be that the map in beta11 is not receiving the data points rather than just a marker image display issue?

Thanks for your willingness to work on this!
Cam