Hi,

I'm trying to use openlayers 6.x2.x-dev to display a map for point coordinates. That does not work, no map is being displayed on the node. This setup was working before, until 6.x-2.x-dev from 2010-May-02 (see #787294: JavaScript popup saying: "with map.options" for this issue). I'm running update.php after every module upgrade, and I've cleared the caches via 'admin_menu' "Clear all caches" several times.

Configuration of openlayers 6.x2.x-dev:

./admin/build/openlayers

./admin/build/openlayers/layers

  • (Default)

Re. this setting: #711550: Some layers can't be added and shouldn't be added

./admin/build/openlayers/presets

  • Default Map (Default)

./admin/build/openlayers/presets

  • Available: Default style, Invisible style, Default select style

API keys for Google maps are entered at ./admin/build/openlayers/layers/settings; other commercial map providers I do not use.

The georeferential data is entered into a CCK field of type "OpenLayers WKT". The widget used is "Openlayers Geocoder".

  • Input Map Preset: Default map
  • Feature Types: Point, Pfad, Polygon

Behaviour:

If I'm editing a node with the geodata field, I'm seeing an Openstreetmap map. If I'm entering a location name in the Openlayers Geocoder field, the map is moved, magnified and centered; a dot symbolizes the location. Other CCK fields are filled with data from Openlayers Geocoder. The WKT field is filled with coordinates like: GEOMETRYCOLLECTION(POINT(23.16006 37.63332)).

After saving the node, I'm getting verbal geodata which was extracted through Openlayers Geocoder, but no map is shown. Also there is no warning or error on the node, but watchdog reports:

  • Type: openlayers
  • Location: ./admin/build/openlayers/layers
  • Referrer: ./admin/build/openlayers/styles
  • Message: Layer not found.
  • Severity: Error

and:

  • Type: openlayers
  • Location: ./admin/build/openlayers/layers/settings
  • Referrer: ./admin/build/openlayers/layers
  • Message: Layer settings not found.
  • Severity: Error

What is going wrong here, and what do I have to do to fix this?

Thanks & greetings, -asb

Comments

tmcw’s picture

Is there a public page where this map should be?

tmcw’s picture

Category: bug » support

Moving to support requests unless there's some kind of bug uncovered here. Are you using any map alters?

asb’s picture

> Is there a public page where this map should be?

What is a public page? The site is live and online, if that's the question. Examples: 26281, 33892, 29953, 35664, 34594, 31982.

Quick cross browser check: Opera 10.53, logged in: No map is displayed on any of these nodes. K-Meleon 1.5.4, anon, shows a map on 33892 and no map on the other nodes.

> Are you using any map alters?

What are map alters? I'm using the defaults, as documented above, if that's the question.

zzolo’s picture

It looks like there are some maps on some of these. Maybe you can give a specific example?

Also, do you have a map formatter set for the CCK field?

Also, I got this error on one of the pages:
Fatal error: Allowed memory size of 209715200 bytes exhausted (tried to allocate 16387 bytes) in /var/www/taxidi/sites/all/modules/service_links/service_links.module on line 496

Do you have enough memory set?

asb’s picture

Continuing cross-browser checks: FF 3.6.3/Win, anon: Displays maps on all nodes except 26281. Interesting. That's a different node type but the same field... Aha, that's how these maps are supposed to look - not zoomed in and not centered?

>Also, do you have a map formatter set for the CCK field?

That would be 'OpenLayers Geocoder', if I understand it correct (see above).

> Do you have enough memory set?

I do not know how much "enough" would be and I never managed to locate a formula for this. If this error occurs, it's most probably too low (it's currently running at a PHP memory_limit of 256M). Hm, either get rid of modules or make the site even slower by raising the memory_limit. Nasty descision. Let's starty by getting rid of Boost (done). OK, now I'm seeing maps logged in in Opera, also. On NID 33892 I'm seing a map of Liberia and Nigeria instead of Tunesia; no coordinate indicator is visible, it's probably outside the map boundaries. Centering and zooming the map would be reallyy/em> nice.

Trying to center and zoom the maps for FF: Overriding "Default Map" at ./admin/build/openlayers/presets; changing:

  • Center & Bounds: Centerpoint: "0,0" (it can not center the point coordinates?); Zoom Level: "4"
  • Behaviors: Zoom to Layer: (Checked); Zoom to location: (Checked); Geocoder query: (Leaving empty); Enable Zoom Wheel: (Unchecked)

Saving. Reloading sample node in FF. For NID 33892 now I'm getting "Error during map rendering." and no map, not even in FF.

Unchecking "Zoom to Layer", Saving. Still no map.

Unchecking "Zoom to location", Saving. Cool, the map reappears in FF!

Checking "Zoom to Layer", Saving. Map is gone, "Error during map rendering" (reproducable). Either this setting is broken, or I don't understand it.

No wait, there's another setting on the CCK field configuration page: "Zoom to Layer" can be enabled without without causing the "Error during map rendering" error. However, the values entered for "Point Zoom Level" are ignored; after saving the field settings it's always reset to "5". Again, either this setting is broken, or I don't understand it.

No wait, after activating "Zoom to Layer" on the "region" content type, I'm getting a "Error during map rendering" on the node editing screen in FF.

Unchecking "Zoom to Layer" at ./admin/content/node-type/region/fields/field_geodaten, Saving. Editing a node of content type "region", no "Error during map rendering" (reproducable), but Openlayer Geocoder doesn't enter it's data into the WKT field. That one we've seen before: #773358: On Adress select, no GEOMETRYCOLLECTION is beeing added to WKT textfield. And once more, either this setting is broken, or I don't understand it.

OK, let's summarize:

  • If no maps are displayed, it might be a memory issue. There's no error in watchdog log about it, and different browsers might behave differently at different times (amount of users? system load? memory usage?); also anonymous and logged in users might influence openlayer's behaviour. If running modules like Image, CCK, Views and Panels, displaying maps might require a PHP memory_limit above 256M.
  • There might be issues with Boost, or disabling Boost might simply free up some memory (not further investigated).
  • The setting "Zoom to Layer" (appearing twice on differnet locations) is either broken, or I don't understand how to use it.
  • There's currently no way to make openlayers to zoom a map to something like "Zoom Level 4" or "Zoom Level 12" and center the map to a point coordinate. So you either have to display a full world map to possibly show all coordinates, or you show a higher Zoom Level, but possibly without the given point coordinate on it. Which would significantly limit the module's use, at least for me.
  • On nodes of type "region" in my case still no maps are displayed, independent from the used browser; examples: NID 26281, 7423, 23656. The geodata field is shared and also used in the other examples (of node type "image"), and it's configured identical. The only difference I'm aware of: Openlayers Geocoder extracts different data by using "Autocompletion", and "image" might have been the first content type where I put this field on. This might be related with #787712: Not all CCK fields are available for autocompletion and #772286: Autocomplete CCK Fields not showing.

Not much learned in the past two hours :-(

Greetings, -asb

tmcw’s picture

The setting "Zoom to Layer" (appearing twice on differnet locations) is either broken, or I don't understand how to use it.

If you're using the CCK display for points, rather than using a view to do it, set the zoom to layer behavior in the CCK display widget, not the preset. Using the CCK display widget is not a great idea architecturally, but if you're stuck with it, then, yeah, set this in there, not in the preset.

There's currently no way to make openlayers to zoom a map to something like "Zoom Level 4" or "Zoom Level 12" and center the map to a point coordinate. So you either have to display a full world map to possibly show all coordinates, or you show a higher Zoom Level, but possibly without the given point coordinate on it. Which would significantly limit the module's use, at least for me.

There is; Point Zoom Level is a setting in OpenLayers Presets. It might not be available in the CCK formatter 'zoom to layer.' The CCK formatter / map widget is really not recommended because CCK for display is really not the best way to do it - views is.

Point zoom level isn't the best way to do this; the best way is to use Geo Taxonomy with bounding boxes, due to the fact that the sizes of countries varies tremendously.

asb’s picture

Status: Active » Closed (won't fix)

> set the zoom to layer behavior in the CCK display widget

OK, resetting the Presets at ./admin/build/openlayers/presets and sticking to the CCK display widgets if that's the way to go.

> CCK for display is really not the best way to do it - views is.
> Point zoom level isn't the best way to do this;
> the best way is to use Geo Taxonomy with bounding boxes, due to the fact that the sizes of countries varies tremendously.

I don't follow. Views to display maps inside nodes? Use Geo Taxonomy to accomplish what? Of course I'd love to get shapes into the locative terms in my "location" vocabulary for countries and regions, but where would I get these shapes, and how would I get them into my terms? Geo Taxonomy doesn't even support Openlayers Geocoder (see #787296: Integration with Geo Taxonomy), and as fasr as I have seen the Google API outputs only point coordinates. And in fact I have not the faintest idea how Geo Taxonomy would help me to display a map on the node types which don't show a map at all, or how it would help me to get rid of the "Error during map rendering" issues.

I think that's it for me. If someone is able to brew a user documentation for this - go ahead. Closing and setting to "won't fix".