I would like to just have the option to create a single point, and if a new point is created it deletes the previous one. At the same time if you click on the point you just added, I would like it to be dragable.

So essential a node only has 1 point.

Sorry if this is something obvious but I've been looking for days to try to find this. I was able to do this with Gmap module.

Files: 
CommentFileSizeAuthor
#4 limit_to_single_point-1630836-3.patch5.04 KBbatje
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]

Comments

Hello,

Just want to point out this is an important issue. I'm discussing this on the following site where they suggest a solution. However this is nog working for me (yet).

http://drupal.stackexchange.com/questions/24327/how-to-limit-number-of-p...

Majo

This is really weird since I have tested this week or two before and I could only put one point there but now as you say, we can put unlimited points on the map.

Has someone found any solution to force one point?

It seems that's what i'm describing here : http://drupal.org/node/1632168#comment-6112288 except that your are under D7 and me D6, but i think it's the same problem

StatusFileSize
new5.04 KB
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]

Attached is a patch that fixes

- a typo
- an error that you dont see but that stops drawing other behaviours if you do not provide an element id
- the limit issue mentioned here.

Status:Active» Needs review

i suppose this patch will be added to the next release of open layers? Or do we have to put this in a queu somewhere?

Majo

You can install this patch see if it works and provide feedback. If that feedback is all good, you can change the status of the issue to "reviewed and tested by the community"

It takes a maintainer to commit the patch to the module, and then make a new release.

To answer your question, this is the queue

Status:Needs review» Reviewed & tested by the community

Just tested right now and it's working good !

Thanks for this interesting patch !

#4: limit_to_single_point-1630836-3.patch queued for re-testing.

subscribe

Patricia,

There is no need to subscribe anymore to get update, you can use the top right button "follow" to do that without alerting all the people subscribed to the thread.

Thanks.

Any chance that we aloc could get a backport to 6.x-2.x?

Status:Reviewed & tested by the community» Needs review

nod_ and/or Jeffshuller, would you please review the patch too ?

As we are not supposed to add new functionnalities to 7.x-2.x, I'm still willing to put this is.

Thanks

Looks good to me. Seems more like a bugfix than a new feature, so RTBC from my point of view.

Status:Needs review» Closed (fixed)

I modified the patch to remove some withespaces and committed it.

Thanks !

http://drupalcode.org/project/openlayers.git/commit/fcdab87

Hi guys,

I'm not sure if I'm using this completely wrong, but shouldn't the limiting feature be in the "Geofield" behaviour instead of the "Draw" behaviour?

In my situation I have a content type with a map as my input. Clicking the map sets the point (must be a single point), but if I have "Draw" selected as a map behaviour, instead of "Geofield", I get an error when editing that field of the content type to say "Error: You have no compatible openlayers maps. Make sure that at least one preset has the 'GeoField' behavior enabled and that it does not have the 'Draw Features' behavior enabled (which is incompatible)."

With the "Geofield" behaviour set, I have "Store each simple feature as a separate field." selected in my field settings, as well as "Required field" checked and the "Number of values" set to 1, but the last two don't seem to be enforced. I can set as many points as I want, or I can set none and the form will still submit. Is there something stupid that I'm missing? I swear I know all the behaviours off by heart now lol.

Cheers :)
Josh

Status:Closed (fixed)» Active

I took files from the last commit. Can't select openlayer map in my node type
( The "Draw Features" bahavior is incompatible - presets with this behavior are not shown.).
Or i made something wrong ?

@roma4ke could you create a new issue for that?

In my case when i apply the patch i get a HTTP Error 500 (Internal Server Error) probably related to the clone of the original map widget.
This error come when i want to edit a content that comes with an openlayers map...

Anyone else having this issue?

@cavla, can you create a new issue for this, and post whatever is happening in your apache error.log file into that issue?

Hi batje,

Thanks for your reply.

I did get rid of the server issue but after applying the patch i still have unlimited points... ;(
Do i need to do smthg after the patching?
Thanks

The patch was committed to the 7.x-2.x-dev version. So, 2 things:

- Install that version. This issue is closed, as the code has been commited.
- If you still find the issue, describe what you are doing to get there in a new issue.

Thanks batje,

I got it Fixed!

I used Xi's solution posted here: drupal.org/node/1773906 and it s working!

I think this is a geofield issue. I did some debugging, and in 7.x-1.1 version, in the geofield.widgets.inc file the geofield_widget_openlayers_afterbuild function cannot get the $settings variable, so the data_storage defaults to 'collection'. This part is missing from the .dev version, so I hope it is working there.
This is a duplicate of http://drupal.org/node/1647416

Status:Active» Fixed

Status:Fixed» Closed (fixed)

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

Status:Closed (fixed)» Fixed

This thread is marked fixed, but can someone tell me how it is fixed?

Is it the patch early in this thread?

Is it the link by calva in #24?

Is it the link by balagan in #25?

I'm using 7.x-2.x and would like this fixed on my site. Thanks.

Hello,

I'm quite busy with other stuff right now, patches are welcome.

Thanks.

This should be marked as a duplicate of http://drupal.org/node/1647416

I am using patch http://drupal.org/node/1647416#comment-6845920
but Mr.bailey's patch http://drupal.org/node/1647416#comment-7114722 is a nicer solution that should be reviewed by the community in order to fix it. Maybe you just use that and give us a feedback. Just checked, it is already reviewed, so just have to apply it.

It's mainly for GeoField then ?

Ah, sorry, you are right. I have meddled with it some time ago and forgot to check it now.

Hmmm.. doesnt' work for me. Even with that patch, user can click any number of points on the map.

Maybe you should post it there. Are you sure you are using geofield v2? Don't know if this bug exists in 1.x version at all.

Status:Fixed» Closed (fixed)

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