I have a CCK-Widget with the default map preset. When I set features on the map an zoom out afterwards, all the features jump to the middle of the map. Please check the attached screenshots.

Comments

zzolo’s picture

Interesting. It almost looks like you have clustering on, but I dont think thats in 2.x at the moment. Do you have Firebug, and if so, do you see any JS errors, or messages in the console?

tmcw’s picture

I've experienced this problem before even with correct projections set. I really just need to devote another hour or two to debugging the CCK update logic - this is a situation in which I think that breaks.

vlad.k’s picture

I checked with Firebug and I don't have any JS-errors in the Firebug console.

I have this problem in three different Drupal installations. I additionally set up a "clean" Drupal installation only with Drupal 6.16, CCK, Views, Openlayers and Openlayers GeoCoder just to check this issue and to make sure that it is not specific for my Drupal configuration. So I'm wondering if any of you guys have this problem?

zzolo’s picture

I have never seen this. Ideally a clean installation would not involve OpenLayers GeoCoder. Though I would think form what @tmcw says, he has seen this with a configuration that does not involve OpenLayers GeoCoder.

martin.l’s picture

StatusFileSize
new116.06 KB
new124.25 KB
new161.14 KB
new171.87 KB
new185.63 KB
new185.66 KB
new184.69 KB

Hello,
I have the same problem.
I tried it with a clean installation: Drupal 6.16, CCK6.x2.6 and Open Layers 6.2-2.x-dev (see Screenshots), Geocoder is not installed. The installation is in German. The module "Views" is not activated.

When creating multiple geotags and zooming in or out the system "forgets" the geotags and places only one near the coast of Africa, see screenshots.

I have added screenshots of the relevant configuration settings.

Is there a solution for this ?

vlad.k’s picture

I've found the solution for this. The projection setting must be "4326 - wms_default, osm_4326_hybrid". I don't really understand what projections are but in [openlayers_cck_drawfeature.js] in the function [update(features)] in line 19 the projection is hardcoded [new OpenLayers.Projection("EPSG:4326")].
Those this mean that only map presets with Map projection EPSG:4326 can be used for CCK Maps?

tmcw’s picture

The reference to 4326 is based on the fact that geometry will always be stored in that projection; this should be compatible with any projection. Possibly displayProjection also needs to be set or something.

martin.l’s picture

Hello,

I tried marsyas solution and it works.

But: I want to user "google-hybrid". This still does not to work.

vlad.k’s picture

There is an error in the projection transformation logic.

If I use a preset with Map Projection 900913 (base layer e.g. Google Maps Hybrid) then the error occurs.
If I use a preset with Map Projection 4326 (base layer Default OpenLayers WMS) then the CCK map widget works.

I can't change the Display Projection, if I set it to 900913 it always is changed back to 4326 after saving.

vlad.k’s picture

After reading this tiket http://drupal.org/node/721434 I can change the Display projection, but the error still occurs.

I tried a Map Projection 900913 (base layer Google Maps Hybrid) with Display Projection 900913 and also with Display Projection 4326 and got the error in both cases.

martin.l’s picture

Same for me.

tmcw’s picture

Status: Active » Needs review

Cool; I looked through the DrawFeature behavior and realized that my understanding of the OpenLayers API was slightly wrong; transform() was actually transforming geometries into 4326 instead of just returning transformed copies. My bad; I've committed a fix ( http://drupal.org/cvs?commit=353234 ) that clones the features object first. Update to this afternoon's dev version of CVS head and retest.

schomsko’s picture

Hello,

UPS -SORRY my server still delivers the old openlayers_cck_drawfeature.js

the problem is still there. I used the dev-version of today. I use 900913 as Map-Projection and 4326 as Display-Projection.
Zooming after drawing a point puts the point near Africa. (Coordinates stay the same in the Text Input Field until saving.)
Drawing more than one point or line puts the previous points or lines near Africa. (Coordinates of previous points change in Text Input Field as well)
But drawing a point, saving the node, editing node with another point works well.

tmcw’s picture

You have cleared your cache (browser and Drupal) and reset Javascript aggregation?

vlad.k’s picture

Hi, my tests where successfull now. Great work!

tmcw’s picture

Status: Needs review » Fixed

Great, marking as fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.