Hello

Playing around with map edition and feature type, I found that the map was always displaying the 3 feature type ('point', 'polygon', 'line') no matter what was checked in the UI behavior...

As i just changed :

$form['feature_types'] = array(
      '#title' => t('Available Features'),
      '#type' => 'checkboxes',
      '#options' => array(
        'point' => t('Point'),
        'path' => t('Path'),
        'polygon' => t('Polygon'),
),

to :

 $form['edit_feature_types'] = array(
      '#title' => t('Available Features'),
      '#type' => 'checkboxes',
      '#options' => array(
        'point' => t('Point'),
        'path' => t('Path'),
        'polygon' => t('Polygon'),
),

And also the corresponding javascript from :

feature_types.push(data.map.behaviors['openlayers_behavior_ole'].feature_types[i]);

to match my new name as :

 feature_types.push(data.map.behaviors['openlayers_behavior_ole'].edit_feature_types[i]);

...the behavior is now working as expected.
=> I guess there is another ['feature_type'] that is defined somewhere after our behavior. This is resulting in overriding the current behavior ['fetaure_type'] by an array of ["point", "path", "polygon"]. Therefore activiting the 3 feature type, no matter what is checked... I don't know where this should come from as I'm discovering the openlayer suite (with complete admiration and astonishment !)
++

Comments

friedjoff’s picture

Hello,

do you have any other modules or behaviors enabled, that could interfere with the OpenLayers Editor module? Because I can't reproduce this error using a plain Cartaro installation.

julien66’s picture

Hello,

Thank for answering,
I did not install Cartaro but have some similar modules installed instead : openlayers, openlayers editor, openlayers ui, postgis, geophp...

I'll dig around a bit more and report back.
++

julien66’s picture

Issue summary: View changes

Mistake in the code.