MultiPolygon in GoogleMap Control ???

May 31, 2011 at 4:02 PM
Edited May 31, 2011 at 4:02 PM

Does anybody have any experiences, how to add MultiPolygon to GoogleMap Control?

I tried to divide MultiPolygon to polygons and add them separately:

for (int j = 1; j < sqlGeo.STNumGeometries() + 1; j++)
{
    GooglePolygon polygon = new GooglePolygon();
for (int i = 1; i < sqlGeo.STGeometryN(j).STNumPoints() + 1; i++)     {     GoogleLocation location = new GoogleLocation();         location.Longitude = Convert.ToDouble(sqlGeo.STGeometryN(j).STPointN(i).Long.Value);         location.Latitude = Convert.ToDouble(sqlGeo.STGeometryN(j).STPointN(i).Lat.Value);         polygon.Points.Add(location);     }     GoogleMap1.Polygons.Add(polygon); }

sqlGeo is variable of SQLGeography type and I have my GeoData from DB in it. I don´t know why nothing appears on the map.