Hi there,

i am using openLayer to place gps positions (setting by user) to a content. But inside of my openlayers map i am not able to set the limit of gps positions to 1.

The same topic is spooken here:

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

But the solution doesnt work.

Plz, anyone has an idea?

Greetings.
-Patrick

Comments

cavla’s picture

Hi there,

I have exactly the same issue.

The openlayers map doesnt allow me to limit the gps points to 1 only.

I have also tried the solution in this link : http://drupal.stackexchange.com/questions/24327/how-to-limit-number-of-p...

But the patch made it worse....

Please someone?

xip’s picture

Thanks for your response:

I found a solution:

openlayers_behavior_geofield.js

change to following:

  //only one feature on each map register before adding our data
  if (Drupal.settings.geofield.data_storage == 'single') {
    dataLayer.events.register('featureadded', $wkt, limitFeatures);
  }

to:

  //only one feature on each map register before adding our data
  //if (Drupal.settings.geofield.data_storage == 'single') {
    dataLayer.events.register('featureadded', $wkt, limitFeatures);
  //}

....ready!!!

cavla’s picture

Woaaaa thank you so much buddy!
It works like a charm now!
Hope they will fix this in the next version...