Can I specify the z-index on a marker for when markers overlap

Mar 28, 2012 at 9:38 AM

I'm progmatically adding markers to a map which is fine. But at the required zoom level some of the markers overlap and I really need to be able to make sure one marker in particular never gets overlapped.

I thought maybe that if I added that marker last it would sit on top but that doesn't work. Please help someone.

 

 

//Display on map

 

using (IDataReader dealerReader = findDealer.GetReader())

(dealerReader.Read())

{

 if (dealerReader["Dealer"].ToString().StartsWith("Britcom"

))

 

{

 

HasBritcom = true;

 

 

britcom.Text = formatbranch(Convert.ToInt32(dealerReader["id"]), Convert.ToInt32(dealerReader["Dealer_Type_ID" ]));

 

britcom.Latitude = Convert.ToDouble(dealerReader["latitude"]);

 

britcom.Longitude =Convert.ToDouble(dealerReader["longitude"]);

 

britcom.IconUrl = DealerIcon(dealerReader["Dealer_Type_ID"]);

 

britcom.IconSize =new GoogleSize(18, 23);

 

}

 

 

else

{ 

 

GoogleMarker bm = new GoogleMarker ();

bm.Text = formatbranch(Convert.ToInt32(dealerReader["id"]), Convert.ToInt32(dealerReader["Dealer_Type_ID"

));

bm.Latitude = Convert.ToDouble(dealerReader["latitude" 

]);

bm.Longitude =Convert.ToDouble(dealerReader["longitude" 

]);

bm.IconUrl = DealerIcon(dealerReader["Dealer_Type_ID"

]);

 

 

if (dealerReader["Dealer_Type_ID"].ToString() == "2" )

{

bm.IconSize =

new GoogleSize

(21, 21);

}

 

else

{

bm.IconSize =new GoogleSize

(18, 23);

}

GoogleMap1.Markers.Add(bm);

GoogleMap1.Zoom = 7;

GoogleMap1.Latitude = Lat;

GoogleMap1.Longitude = longitude;

GoogleMap1.Directions.Clear();

}

}

 

dealerReader.Close();

dealerReader.Dispose();

}

 

 

//add marker last to sit on top

 

if

(HasBritcom)

{

GoogleMap1.Markers.Add(britcom);

GoogleMap1.Zoom = 7;

GoogleMap1.Latitude = Lat;

GoogleMap1.Longitude = longitude;

GoogleMap1.Directions.Clear();

}

{

 while