Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
tmcw CreditAttribution: tmcw commentedI'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.
Comment #2
chris_huh CreditAttribution: chris_huh commentedAh 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
Comment #3
tmcw CreditAttribution: tmcw commentedYes, that problem is documented in this issue - are there any other problems?
Comment #4
chris_huh CreditAttribution: chris_huh commentedOh 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).
Comment #5
tmcw CreditAttribution: tmcw commentedYou can try using the zoom to features or zoom to layer behavior to zoom the map on load?
Comment #6
chris_huh CreditAttribution: chris_huh commentedI tried that, to no avail. I'll just have to see what else there is
Comment #7
zzolo CreditAttribution: zzolo commented@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.
Comment #8
chris_huh CreditAttribution: chris_huh commentedThanks, i might look at the hook_openlayers_map_alter() but i don't think there is a major rush to get it working yet.
Comment #9
tmcw CreditAttribution: tmcw commentedYou 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?
Comment #10
chris_huh CreditAttribution: chris_huh commentedI 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
Comment #11
zzolo CreditAttribution: zzolo commentedThe 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.
Comment #12
tmcw CreditAttribution: tmcw commentedYes, 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.
Comment #13
tmcw CreditAttribution: tmcw commentedAny luck?
Comment #14
chris_huh CreditAttribution: chris_huh commentedI haven't had time to look into it, and not even sure if I will need it anytime soon now.
Comment #15
zzolo CreditAttribution: zzolo commentedMoving 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