diff --git a/leaflet.module b/leaflet.module
index 8c16906..a80ee9d 100644
--- a/leaflet.module
+++ b/leaflet.module
@@ -170,18 +170,32 @@ function leaflet_process_geofield($items = array()) {
         break;
 
       case 'multipolygon':
+        $components = [];
+        $tmp = $geom->getComponents();
+        foreach ($tmp as $delta => $polygon) {
+          $polygon_component = $polygon->getComponents();
+          foreach ($polygon_component as $delta => $linestring) {
+            $components[] = $linestring;
+          }
+        }
+        foreach ($components as $key => $component) {
+          $subcomponents = $component->getComponents();
+          foreach ($subcomponents as $subcomponent) {
+            $datum['component'][$key]['points'][] = array(
+              'lat' => $subcomponent->getY(),
+              'lon' => $subcomponent->getX(),
+            );
+          }
+        }
+
+        $data[] = $datum;
+        break;
       case 'multipolyline':
       case 'multilinestring':
         if ($datum['type'] == 'multilinestring') {
           $datum['type'] = 'multipolyline';
         }
-        if ($datum['type'] == 'multipolygon') {
-          $tmp = $geom->getComponents();
-          $components = $tmp[0]->getComponents();
-        }
-        else {
-          $components = $geom->getComponents();
-        }
+        $components = $geom->getComponents();
         foreach ($components as $key => $component) {
           $subcomponents = $component->getComponents();
           foreach ($subcomponents as $subcomponent) {
@@ -190,7 +204,6 @@ function leaflet_process_geofield($items = array()) {
               'lon' => $subcomponent->getX(),
             );
           }
-          unset($subcomponent);
         }
         break;
     }
