Hi!
I just setup 2x version and can't build views, because when I choose OpenLayers Map style I can't do anything except choosing of preset. I can't even add fields because this plugin can't use fields. Is it normal?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tmcw’s picture

Category: bug » support

You'll need to create an OpenLayers Data view (add an OpenLayers Data display to your view), to which you can add fields and configure it. See the tutorial for complete details.

Daniel A. Beilinson’s picture

I can't get points on the map. Not with openlayers, not with geo. Can't get it. I see map, but can't see points, I tried with few presets.

tmcw’s picture

We need more information than that, and make sure that you are following the instructions, adding data layers to map presets, making sure that the point style is not 'Invisible' and making an OpenLayers Data view.

Daniel A. Beilinson’s picture

Hi again, Tom!
I just make clean MAMP drupal installation and find some bugs. So, I can describe this process by steps:

Step 1. Drupal installation - core, openlayers 2.x alpha2 (ol core, ol cck, ol ui, ol views), cck content 6.x-3.x-dev, views 6.x-2.8 (views core, views ui), ctools 6.x-1.3.
Step 2. Configure OL module. Moved API archive to OL folder and changing OL source to sites/all/modules/openlayers/OpenLayers-2.8/OpenLayers.js
Step 3. Adding cck OL WKT field. After I added new field with map widget I added new content. So I can see something like this:

test
Wed, 02/17/2010 - 21:23 — Integral
test:
GEOMETRYCOLLECTION(POINT(4715858.8962375 6692214.699225))

But when I tried to edit content I can't see test field value, it disappeared. So this's the first bug.
Step 4. Change test field display option. After changing cck basic display options for test field to OpenLayers Map: Default Map - I receive this warning:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'theme_openlayers_cck_formatter_map' was given in /Applications/MAMP/htdocs/includes/theme.inc on line 617.
So I deceided to change OL cck field to geo cck field (but geo experience also can be apply to OL cck).
Step 5. Installing 6.x-1.0-alpha4 version of geo module and geo field module. Adding new WKT field "test2" and POINT(-95.677068 37.0625) value.
Step 6. Building view. Adding OpenLayers Data style display and OpenLayers data style. Adding field test2 with WKT widget. Chnaging OpenLayers Data: Style options - Map Data Sources: WKT - test2 field. Adding new page display with overriden style openlayers map with default map. Can't see anything. It's because default preset can't show data layer. Ok.
Step 7. Going to openlayers and adding new preset with 900913 projection and osm_mapnik base layer and default style with test_openlayers_1 - - OpenLayers Data enabled and activated. So I going back to the views changing map style and... Ooops! It's worked - I can see the point. It's strange because I didn't see anything yesterday... Well, okay, I tried to do same steps with OL cck and I can't see points.
And there's another bug. When I try to change input widget's map to my new preset - I can't see this map. I only see large white space and WKT's textarea.

zzolo’s picture

Just a note. You should be using the stable version of CCK. you said you are using a dev version. I am not actually saying these are caused from that version, but we cannot support a development cersion of cck when this module is still alpha.

The 2.x branch of this module does not support geo that I know of. (I am not sure if the OpenLayers WKT views handler part would support arbitrary WKT)

Also, when a map doesn't show up, it is best to have Firebug installed so that you can see if there are any Javascript errors that appear.

I know I am not providing an answer yet, but if we cant get some actual errors and a more stable environment, it will save a lot of time. Thanks.

Daniel A. Beilinson’s picture

Well, I try to do it with cck-6.x-2.6, I received same warning:

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'theme_openlayers_cck_formatter_map' was given in /Applications/MAMP/htdocs/includes/theme.inc on line 617.

Unfortunately, your fields are broken - see #4 step 3.
I try to catch JS error, but now I have WSOD when I try to create content:

[18-Feb-2010 10:30:15] PHP Fatal error: Cannot access empty property in /Applications/MAMP/htdocs/sites/all/modules/openlayers/modules/openlayers_views/views/openlayers_views_style_data.inc on line 275

tmcw’s picture

Only Views output of OpenLayers maps is currently supported. I'll work on getting CCK display to work. However, Geo, geo fields, geo displays, etc., will not be supported by 2.x.

Daniel A. Beilinson’s picture

I don't really understand you, I don't talking about geo (btw it's working now), I talk about your cck fields (OpenLayers WKT) - it isn't working and WKT values doesn't stored.

Daniel A. Beilinson’s picture

Title: OL 2x Views » broken cck formatter
Component: OpenLayers Views » OpenLayers CCK
Category: support » bug

Changing title, because broken OL's cck wkt formatter is cause and empty views display is effect.

tmcw’s picture

Patches are welcome, I won't have the time to invest in this for at least a few days.

tmcw’s picture

Status: Active » Needs review

Test with the latest dev version. I've made several corrections to this area of the code and your usage should work now.

Daniel A. Beilinson’s picture

Perfectly! Thanks!
But there's also some buggy things.
Look at this WKT:

GEOMETRYCOLLECTION(POINT(1.6347084120353e-34 0),POINT(1.653477590438e-29 0),POINT(1.5938527331789e-24 0),POINT(9.7298608669293e-20 0),POINT(5.3136747822102e-14 3.8166656177562e-14),POLYGON((5.1352780269323e-14 2.5444437451708e-14,3.861015489232e-14 2.5444437451708e-14,4.6765435133601e-14 3.8166656177562e-14,5.5175567882424e-14 3.8166656177562e-14,5.1352780269323e-14 2.5444437451708e-14)),POINT(3.4185911892173e-9 2.7214479743036e-9),POINT(0.00020054186911144 0.0003960455147435),POINT(44.82421874821 52.908902046263))

It's returning map from screenshot.

And again - there is no zoom to layer and no js errors. Only this warnings:

Warning: Expected color but found 'undefined'. Error in parsing value for 'fill'. Declaration dropped.
Source File: http://localhost:8888/?q=node/6
Line: 0
zzolo’s picture

I can confirm I get this behavior as well. If I add a number of different features, it seems like only a couple show up. Haven't looked into this further.

tmcw’s picture

That WKT is likely a result of a map with incorrect projections; the points are incredibly close to 0, 0. What is the projection and display projection of the map you're using as CCK input?

tmcw’s picture

Status: Needs review » Closed (duplicate)