Index: /g-map/package.xml
===================================================================
--- /g-map/package.xml (revision 1325)
+++ /g-map/package.xml (revision 1378)
@@ -10,5 +10,5 @@
 		<packagedescription language="it"><![CDATA[Questo pacchetto aggiunge una mappa di Google sul tuo forum.]]></packagedescription>
 		<isunique>1</isunique>
-		<version>2.0.5</version>
+		<version>2.0.6</version>
 		<date>DATE</date>
 		<plugin>com.woltlab.wcf</plugin>
@@ -45,4 +45,9 @@
 		<eventlistener>eventlistener.xml</eventlistener>
 	</instructions>
+	
+	<instructions type="update" fromversion="2.0.5">
+		<files>files.tar</files>
+		<templates>templates.tar</templates>
+        </instructions>
 	
 	<instructions type="update" fromversion="2.0.4">
Index: /g-map/files/lib/data/gmap/GmapCluster.class.php
===================================================================
--- /g-map/files/lib/data/gmap/GmapCluster.class.php (revision 1236)
+++ /g-map/files/lib/data/gmap/GmapCluster.class.php (revision 1378)
@@ -80,5 +80,5 @@
 	 * @param	$markers	Array of lat and lon locations.
 	 */
-	public function getMarkers(array $markers, $pick = array()) {
+	public function getMarkers(array $markers, $pick = null) {
 		$clustered = array();
 
@@ -104,6 +104,13 @@
 			if (count($cluster) > 0) {
 				$cluster[] = $marker;
+				if($pick !== null && count($clustered) == $pick - 1) {
+					$tmp = $this->getCluster($cluster, true);
+					return $tmp['ids'];
+				}
 				$clustered[] = $this->getCluster($cluster);
 			} else {
+				if($pick !== null && count($clustered) == $pick - 1) {
+					return array($marker['id']);
+				}
 				$clustered[] = $marker;
 			}
@@ -116,5 +123,5 @@
 	 * @param	$markers	Array of lat and lon locations.
 	 */
-	public function getIDs(array $markers, $lat, $lon) {
+	public function getIDs(array $markers, $idx) {
 
 		/* Loop until all markers have been compared. */
Index: /g-map/files/lib/page/MapAjaxPage.class.php
===================================================================
--- /g-map/files/lib/page/MapAjaxPage.class.php (revision 1374)
+++ /g-map/files/lib/page/MapAjaxPage.class.php (revision 1378)
@@ -54,4 +54,7 @@
 		$this->lat = isset($_GET['lat']) ? floatval($_GET['lat']) : 0;
 		$this->lon = isset($_GET['lon']) ? floatval($_GET['lon']) : 0;
+		
+		// pick action
+		$this->idx = isset($_GET['idx']) ? intval($_GET['idx']) : 0;
 	}
 
@@ -90,5 +93,5 @@
 		$cluster = new GmapCluster($this->distance, $this->zoom);
 		if($this->action == 'pick') {
-			$ids = $cluster->getIDs($markers, $this->lat, $this->lon);
+			$ids = $cluster->getIDs($markers, $this->idx);
 			if($ids === null) {
 				$this->datapoints = array();	
Index: /g-map/files/js/gmap/AjaxMap.class.js
===================================================================
--- /g-map/files/js/gmap/AjaxMap.class.js (revision 1273)
+++ /g-map/files/js/gmap/AjaxMap.class.js (revision 1378)
@@ -24,6 +24,5 @@
 		url += '&bounds=' + this.boundsUsed;
 		url += '&action=pick';
-		url += '&lon=' + marker.getLatLng().x;
-		url += '&lat=' + marker.getLatLng().y;
+		url += '&index=' + marker.index;
 		var ajaxRequest = new AjaxRequest();
 		ajaxRequest.openGet(url + SID_ARG_2ND, function (map, id) {
@@ -100,4 +99,5 @@
 								marker = new GMarker(coordinates);
 							}
+							marker.index = i;
 							GEvent.addListener(marker, "click", function (map, marker) {
 								return function () {
