3

Im using the modules stuck very similar to one described here ( Need a simple Google Maps solution; lost in the labyrinth of modules).

Geofield, Openlayers, Drupal 7 

The difference is that I dont use Address field for auto detecting the lat/lang from address. The Geofield field widget type is set to "Openlayers map" so the points can be manually added by user to the map when the node is being edited.

Is there any way to limit the maximum number of points that user can mark on map? (to 1)

4 Answers 4

1
  1. In the settings of the GeoField you'd like to limit the entry for, set Storage Options to 'Store each simple feature as a separate field.'
  2. Then in Location field settings, you can set the limit to one.

Number 1 is important, as it will make sure that clicking on the map a second time, moves the point around, instead of creating new points.

3
  • I tried it as you describes but it still possible to add more points, even with the limit to 1.
    – user7965
    Jun 12, 2012 at 11:17
  • Strange, let's dig into this. The map settings of the map you're using to do the input (under admin/structure/openlayers/maps) might be important. I've noticed that enabling some options messes up the experiences here and there. These are the settings I used under the 'Behavoirs' section of the map I'm using: i.stack.imgur.com/LwUaz.jpg, i.stack.imgur.com/wP9fL.jpg. Does that have any effect? Jun 12, 2012 at 13:04
  • Didn't work for me, with the behaviors as you described, the user can still select multiple points. Maybe what you mean in "Location field settings" is something different than the "Number of values" ?
    – Shushu
    Feb 10, 2013 at 8:19
1

Try the 7.x-2.x-dev version of geofield. It fix this bug.

0

If you go to your content type > manage fields and click edit next to your Geofield, then scroll to the bottom of the page you should have options for Multi-value input handling and Number of values either/both if these should give you the control you want.

0

If you go to your content type > manage fields and click edit next to your Geofield, then scroll to the bottom of the page you should have options for set Storage Options to 'Store each simple feature as a separate field. check thisn as it is a radio button

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.