I added a location cck field with a OpenLayers WKT, but no map is displayed, just the space the map should be in and the long/lat box below. The map preset i am using works with a view, so i don't see how it would be that.

Also, what are the advantages of 2 over 1. Is it worth it, even thought its in alpha?

Comments

tmcw’s picture

I'm a little confused - are you using 1.x or 2.x? If you're using 2.0-alpha2, upgrade to 2.x-dev and retest. There will be a new release (alpha3) very soon, but for now, the dev work has a lot of fixes pertaining to CCK that will likely fix your problem.

chris_huh’s picture

Ah yes, upgrading to the dev shows a map. But i only want them to post one location, with the map they can post as many as they want. i have changed the value in the content type options to be 1 and that hasn't done anything.

I was using 2.0alpha2 before

tmcw’s picture

Yes, that problem is documented in this issue - are there any other problems?

chris_huh’s picture

Oh ok.

Well now i've got that to work i notice that the map displayed on the node page (after the node has been made) doesn't center the item in the middle of the map, which i would like it to. Is there a way to do this.

Also, is 2 much better than 1, because i tried 1 and it seemed to work fine (but maybe i am merging some of the features of 1 and 2 in my head).

tmcw’s picture

Category: bug » support

You can try using the zoom to features or zoom to layer behavior to zoom the map on load?

chris_huh’s picture

I tried that, to no avail. I'll just have to see what else there is

zzolo’s picture

@chris_huh As far as the different branches, the 1.x branch is stable, but it will not get any new features or any serious development. The 2.x branch is still being developed but is fairly stable given the alpha status and has some major changes to the architecture and map UI.

Currently, in the 1.x branch the zoom to layer functionality is in the CCK module, but not in the 2.x. This will be ported over eventually.

To get this functionality "instantly" in 2.x, you will probably have to use the hook_openlayers_map_alter() to put in that behavior manually.

chris_huh’s picture

Thanks, i might look at the hook_openlayers_map_alter() but i don't think there is a major rush to get it working yet.

tmcw’s picture

Priority: Normal » Minor

You can simply add the behavior to your preset (the cck map preset, etc) and it'll work, I'm not sure why zzolo mentions hook_alters. The zoom to layer behavior is in the 2.x branch, but not built into the cck map preset, although it would be a simple addition. Perhaps there's something I'm not understanding here?

chris_huh’s picture

I can select zoom to layers as a behaviour in the preset, but the only layer available is osm_mapnik. Do i need that layer to be changed to something else for it to work. Do i have to make a view that creates the layer just for that single node. At the moment the only layer i have avaiable (other than the osm_mapnik) is a view that i created to show all the nodes of a certain type. But i want this map to just show the relevant node, not them all

zzolo’s picture

The reason I think the hook is needed because you cannot select the CCK layer through the map preset UI for the layer to zoom to, because it doesn't know about it (as far as I know). I have not tested this.

tmcw’s picture

Yes, you'll need to use the map alter to do this directly. I would imagine that you can also make an OpenLayers Data view that has an argument it catches from the Node URL to get the points for that node, and then add that layer and select to zoom to it.

tmcw’s picture

Any luck?

chris_huh’s picture

I haven't had time to look into it, and not even sure if I will need it anytime soon now.

zzolo’s picture

Status: Active » Fixed

Moving discussion on CCK center to layer here, as the original point of this issue was taken care of: #764340: Add zoom_to_layer option in CCK

Status: Fixed » Closed (fixed)

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