diff --git a/gmap.module b/gmap.module
index 097ba73..1ae3778 100644
--- a/gmap.module
+++ b/gmap.module
@@ -1310,6 +1310,69 @@ function gmap_views_plugins() {
   );
 }
 
+
+/**
+ * Implementation of hook_views_ajax_data_alter().
+ */
+function gmap_views_ajax_data_alter(&$commands, $view) {
+  
+  $plugin_styles = array ($view->plugin_name);
+  foreach ($view->display as $display)
+    $plugin_styles[] = $display->display_options['style_plugin'];
+  if (! (in_array ('gmap', $plugin_styles) || in_array ('gmap', $plugin_styles)))
+    return;
+
+  foreach ($commands as &$c) {
+    if ('insert' == $c['command'])
+      $c['command'] = "gmapRepaint";
+  }
+  
+}
+
+/**
+ * Implementation of hook_views_pre_render().
+ */
+function gmap_views_pre_render(&$view) {
+  
+  static $gmap_processed;
+  // Add js only for gmap style views with ajax and not already processed.
+  if (($view->plugin_name != 'gmap' && $view->plugin_name != 'gmapextended')
+          || !$view->use_ajax || $gmap_processed) {
+    return;
+  }
+  // Mark the view as already processed.
+  $gmap_processed = TRUE;
+  // Add js with new views callback.
+  drupal_add_js(drupal_get_path('module', 'gmap') . '/js/gmap_views_ajax.js', array('group' => JS_DEFAULT));
+  
+}
+
+function gmap_ajax_render_alter(&$command) {
+  
+  $hasGmapRepaint = false;
+  foreach ($command as $c) {
+    if ('gmapRepaint' == $c['command']) {
+      $hasGmapRepaint = true;
+      break;
+    }
+  }
+
+  if ($hasGmapRepaint) {
+
+    $settings;
+    foreach ($command as $c) {
+      if ('settings' == $c['command']) {
+        $settings = $c['settings'];
+        break;
+      }
+    }
+
+    $mapids = array_keys($settings['gmap']);
+    array_splice($command, 0, 0, array(array('command' => 'gmapClearMarker', 'mapid' => $mapids)));
+  }
+  
+}
+
 function theme_gmap_views_ui_gmapextended($variables) {
   $form = $variables['form'];
 
diff --git a/js/gmap_views_ajax.js b/js/gmap_views_ajax.js
new file mode 100644
index 0000000..ff49bff
--- /dev/null
+++ b/js/gmap_views_ajax.js
@@ -0,0 +1,24 @@
+(function ($) {
+	
+Drupal.ajax.prototype.commands.gmapClearMarker = function (ajax, response, status) {
+	
+	for ( var i in response.mapid ) {
+		var id = response.mapid[i];
+		delete Drupal.settings.gmap[id].markers;
+	}
+	
+};
+
+Drupal.ajax.prototype.commands.gmapRepaint = function (ajax, response, status) {
+	
+	var mapid = jQuery( response.selector + ' .gmap').attr('id').replace(/gmap-(.*)-gmap./,"$1");
+	
+	var map = Drupal.gmap.getMap( mapid );
+	if ( map ) {
+		map.change('clearmarkers',-1);
+		map.change('iconsready',-1);
+	}
+	
+};
+
+})(jQuery);
