Hi,

Thanks again for a wonderful module that I continue to enjoy working with. I think the semantic change in hook names is really good as well. I am trying to use polygons stored in WKT fields to create popups on click. I am using Geofield's WKT field, but am not sure I actually need it. Could probably get by with just a textfield storing the data. I then have a map view and a data view, which pull in my polygon content type and display them on my preset. In 7.x-2.0-alpha0 my polygon appeared nicely, but the popup would not appear. If I changed it to tooltip it worked fine. I found an issue some place with a similar report that suggested upgrading to 7.x-2.x-dev. Upon upgrading, I of course ran into the hook name change. I changed the hook_openlayers_presets to hook_openlayers_maps and all the errors went away. However, now my polygon will not appear at all. I tried using a text field instead of the Geofield WKT, but no luck. Any suggestions on my problem or whether or not I need to use Geofield at all. Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zzolo’s picture

Hi @lkacenja. The first place to start is to look at your Views OL Data Overlay layer. In the preview now, there is a dump of the data that OL is getting. Make sure this looks right to you.

lkacenja’s picture

Hi zzolo,

I appreciate the suport. Here is the data views is outputting:

You can use the following parameters in your styles as dynamic values
------------
${title_rendered}
${title}
${field_state_bounds_rendered}
${field_state_bounds}
${name}
${description}

------------
The following is a dump of the data that is rendered from this display. It is used for debugging purposes only.
        array (
  0 => 
  array (
    'projection' => '4326',
    'attributes' => 
    array (
      'title_rendered' => '<a href="/content/wyoming">Wyoming</a>',
      'title' => 'Wyoming',
      'field_state_bounds_rendered' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
      'field_state_bounds' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
      'name' => '<a href="/content/wyoming">Wyoming</a>',
      'description' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
    ),
    'wkt' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
  ),
  1 => 
  array (
    'projection' => '4326',
    'attributes' => 
    array (
      'title_rendered' => '<a href="/content/idaho">Idaho</a>',
      'title' => 'Idaho',
      'field_state_bounds_rendered' => NULL,
      'field_state_bounds' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
      'name' => '<a href="/content/idaho">Idaho</a>',
      'description' => NULL,
    ),
    'wkt' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
  ),
  2 => 
  array (
    'projection' => '4326',
    'attributes' => 
    array (
      'title_rendered' => '<a href="/content/utah">Utah</a>',
      'title' => 'Utah',
      'field_state_bounds_rendered' => NULL,
      'field_state_bounds' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
      'name' => '<a href="/content/utah">Utah</a>',
      'description' => NULL,
    ),
    'wkt' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
  ),
  3 => 
  array (
    'projection' => '4326',
    'attributes' => 
    array (
      'title_rendered' => '<a href="/content/new-mexico">New Mexico</a>',
      'title' => 'New Mexico',
      'field_state_bounds_rendered' => NULL,
      'field_state_bounds' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
      'name' => '<a href="/content/new-mexico">New Mexico</a>',
      'description' => NULL,
    ),
    'wkt' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
  ),
  4 => 
  array (
    'projection' => '4326',
    'attributes' => 
    array (
      'title_rendered' => '<a href="/content/montana">Montana</a>',
      'title' => 'Montana',
      'field_state_bounds_rendered' => NULL,
      'field_state_bounds' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
      'name' => '<a href="/content/montana">Montana</a>',
      'description' => NULL,
    ),
    'wkt' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
  ),
  5 => 
  array (
    'projection' => '4326',
    'attributes' => 
    array (
      'title_rendered' => '<a href="/content/colorado">Colorado</a>',
      'title' => 'Colorado',
      'field_state_bounds_rendered' => NULL,
      'field_state_bounds' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
      'name' => '<a href="/content/colorado">Colorado</a>',
      'description' => NULL,
    ),
    'wkt' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
  ),
  6 => 
  array (
    'projection' => '4326',
    'attributes' => 
    array (
      'title_rendered' => '<a href="/content/arizona">Arizona</a>',
      'title' => 'Arizona',
      'field_state_bounds_rendered' => NULL,
      'field_state_bounds' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
      'name' => '<a href="/content/arizona">Arizona</a>',
      'description' => NULL,
    ),
    'wkt' => 'POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))',
  ),
)

Looks pretty good to me. I think this is the same output as before the version change. Thanks.

lkacenja’s picture

Status: Active » Closed (works as designed)

I think it was a views configuration problem. I think the upgrade must have changed some settings. Thanks for the help.

Just as a note: the geo field module was not necessary for simple polygon data overlays. A plain text area to store the WKT works like a charm.

khan2ims’s picture

Version: 7.x-2.x-dev » 7.x-2.0-beta3

Hi,

I am also having the same problem. The polygon shows as a marker instead of polygon area. I am using beta3 version and WKT formatter for my geofield. The output of the OpenLayers Data Overlay shows the correct format for the polygon. I have tried all combinations available in formatter, but can't get the polygon displayed on the map.

On my node display, I have set the display format as Geofield Map and there it shows the polygon properly. So, I guess there is some settings issue either in Views or the Layer display.

Can someone please help?

Pol’s picture

khan2ims’s picture

Hi,

My layers display screen is different from yours. See this projection screenshot for example http://screencast.com/t/2riCBxzG and I don't get projection EPSG:3857. I tried changing the base layer and still the polygon area shows as a marker. See http://screencast.com/t/y3oRLA8FJpxW

If I enable creation of layer in cck kml upload field here http://screencast.com/t/x6yKBxMbVye and attach it to a map and enable its layer, that shows up as a polygon. Strange.

Can I please get export of your views? I think I am using some wrong settings there.

g76’s picture

I have the same problem, and am fairly certain it's the views settings as well. I am using the dev version not the beta. If anyone has figured this out, let me know. Also if there is any info I can give to help troubleshoot this, please let me know as well.
Here is my data dump from the view:

You can use the following parameters in your styles as dynamic values
------------
${title_rendered}
${title}
${field_ryse_loc_region_rendered}
${field_ryse_loc_region}
${name}

------------
The following is a dump of the data that is rendered from this display. It is used for debugging purposes only.
        array (
  0 => 
  array (
    'projection' => 'EPSG:4326',
    'attributes' => 
    array (
      'title_rendered' => '<a href="/content/region-sample">Region Sample</a>',
      'title' => 'Region Sample',
      'field_ryse_loc_region_rendered' => 'POLYGON ((-74.531250011397 8.2854224142667, -68.554687511636 10.712425631223, -59.765625011987 9.6744004754851, -59.765625011987 3.03958672728, -79.453125011201 -3.6362306019631, -79.453125011201 -3.9870148943017, -74.531250011397 8.2854224142667))',
      'field_ryse_loc_region' => 'POLYGON ((-74.531250011397 8.2854224142667, -68.554687511636 10.712425631223, -59.765625011987 9.6744004754851, -59.765625011987 3.03958672728, -79.453125011201 -3.6362306019631, -79.453125011201 -3.9870148943017, -74.531250011397 8.2854224142667))',
      'name' => '<a href="/content/region-sample">Region Sample</a>',
    ),
    'style' => NULL,
    'wkt' => 'POLYGON ((-74.531250011397 8.2854224142667, -68.554687511636 10.712425631223, -59.765625011987 9.6744004754851, -59.765625011987 3.03958672728, -79.453125011201 -3.6362306019631, -79.453125011201 -3.9870148943017, -74.531250011397 8.2854224142667))',
  ),
)
g76’s picture

g76’s picture

Status: Closed (works as designed) » Active

I hope it's okay to reopen this.