With drupal 8.3.0-alpha1 'Leaflet map' views style option window displays:

Please add at least one geofield to the view.

If disable condition in line 174 of /leaflet_views/src/Plugin/views/style/LeafletMap.php:
if (is_a($handler, '\Drupal\views\Plugin\views\field\Field')) {
geofield list is back.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

madar created an issue. See original summary.

madar’s picture

Title: No field recognized in "Leaflet map" views style settings in 8.3.0-alpha1 » No field recognized in 'Leaflet map' views style settings in 8.3.0-alpha1
Issue summary: View changes
friera’s picture

It works for me!

abrakadobr’s picture

i confirm problem, and confirm patch with addon:

if ($field_storage_definition) { //i've got error "null has no method getType"                                                                                                                        
  if ($field_storage_definition->getType() == 'geofield' || strpos($label,'wkt') !== false) {                                                             
    $fields_geo_data[$field_id] = $label;                                                                                                                 
  }                                                                                                                                                       
}
madar’s picture

Abrakadobr solution works for me on 8.3.0. Here is a patch with code from #4.

nottaken’s picture

#5 patch worked for me.

ipwa’s picture

I can now choose the geofield but when trying to view the map I get an error.

waspper’s picture

Patch provided in #5 made my Views map style -- Leaflet (Old) -- to work nicely.

Grimreaper’s picture

Status: Active » Needs review

Hello,

I applied the patch from #5 and it solved the problem thanks.

marcoscano’s picture

FileSize
922 bytes
1.37 KB

I don't think the approach in #5 is the safest one.

If we just use the correct class we can keep the first conditional. The patch attached solves the problem for me.

Tim Bozeman’s picture

FileSize
913 bytes

Rerolling #10 which seems to be doing the job.

polynya’s picture

Patch #10 is working correctly. Patch #11 cannot be applied to 8.x-1.x branch.

ckaotik’s picture

Patch in #10 works like a charm and applies cleanly to the 8.x-1.x dev branch.

The patch in #11 only applies to 8.x-1.0-beta1, but not to the current dev release. That code was changed on 2016-10-11.

ckaotik’s picture

Status: Needs review » Closed (duplicate)

Just realized that this is a duplicate of #2839538: LeafletMarker could not recognize geofield. That issue has an RTBC patch, so let's go with that instead.