some of the marker are not loading

Sep 24, 2010 at 12:23 AM

Hi All,

First of all this is a great control and saved me tons of code. I am using this control in a SharePoint 2010 webpart thru embedding the artem google map in a user control. I am using 4.1 release.

If you load this URL you will see sometimes it maps more points and sometimes it doesnt. I am stumbled and dont know what exactly to do fix this issue.

http://sharepointdev6.cgap.org/default.aspx?IsDlg=1

 

basically i am reading from a dataset and adding the custom marker

if

(!IsPostBack)

{

string htmlInfoContent = string

.Empty;

GoogleMap gmap = new GoogleMap

();

gmap.Width = 1024;

gmap.Height = 800;

gmap.EnableContinuousZoom =

true

;

gmap.EnableInfoWindow =

true

;

gmap.Zoom = 2;

gmap.BorderStyle =

BorderStyle

.Solid;

gmap.BorderColor = System.Drawing.

Color

.Black;

gmap.BorderWidth = 1;

gmap.Latitude = 38.901661;

gmap.Longitude = -77.043655;

gmap.ZoomPanType =

ZoomPanType

.Large3D;

gmap.EnableScrollWheelZoom =

true

;

gmap.EnableDoubleClickZoom =

true

;

gmap.EnableMarkerManager =

true

;

 

 

CreateLocations(

true, true, true

);

string city = string

.Empty;

string Status = string

.Empty;

string HtmlContent = string

.Empty;

string strIsPast = string

.Empty;

string strIsPresent = string

.Empty;

string strIsFuture = string

.Empty;

StringBuilder travelInfoHtml = new StringBuilder

();

for (int

i = 0; i < locationName.Rows.Count; i++)

{

DataRow

dr = locationName.Rows[i];

city = dr[

"Location"

].ToString();

Status = dr[

"Status"

].ToString();

HtmlContent = dr[

"HtmlContent"

].ToString();

string[] statuses = Status.Split(','

);

strIsPast = statuses[0];

strIsPresent = statuses[1];

strIsFuture = statuses[2];

 

if (strIsPast.Equals("1"

))

{

GoogleMarker markerPast = new GoogleMarker

(city);

markerPast.Text = HtmlContent;

markerPast.IconUrl =

"~/_layouts/images/kpipeppers-2.gif"

;

markerPast.IconSize =

new GoogleSize

(10, 10);

markerPast.Title = city;

LiteralControl markerInfoControl1 = new LiteralControl

(HtmlContent);

markerPast.InfoContent.Controls.Add(markerInfoControl1);

markerPast.Address = city;

markerPast.OpenInfoBehaviour =

OpenInfoBehaviour

.MouseOver;

 

gmap.Markers.Add(markerPast);

System.Threading.

Thread

.Sleep(10);

}

if (strIsFuture.Equals("1"

))

{

GoogleMarker markerFuture = new GoogleMarker

(city);

markerFuture.Title = city;

markerFuture.Text = city;

markerFuture.IconSize =

new GoogleSize

(12, 12);

markerFuture.IconUrl =

"~/_layouts/images/kpidefault-0.gif"

;

LiteralControl markerInfoControl2 = new LiteralControl

(HtmlContent);

markerFuture.InfoContent.Controls.Add(markerInfoControl2);

markerFuture.Address = city;

markerFuture.OpenInfoBehaviour =

OpenInfoBehaviour

.MouseOver;

 

gmap.Markers.Add(markerFuture);

System.Threading.

Thread

.Sleep(10);

}

if (strIsPresent.Equals("1"

))

{

GoogleMarker markerPresent = new GoogleMarker

(city);

markerPresent.Title = city;

markerPresent.Text = city;

markerPresent.IconSize =

new GoogleSize

(14, 14);

markerPresent.IconUrl =

"~/_layouts/images/kpipepperslarge-1.gif"

;

LiteralControl markerInfoControl3 = new LiteralControl

(HtmlContent);

markerPresent.InfoContent.Controls.Add(markerInfoControl3);

markerPresent.Address = city;

markerPresent.OpenInfoBehaviour =

OpenInfoBehaviour

.MouseOver;

 

gmap.Markers.Add(markerPresent);

System.Threading.

Thread

.Sleep(10);

}

}

this

.Controls.Add(gmap);

}

 

#region

manual entries

#endregion

}

catch (Exception

ex)

{

SPDiagnosticsService

.Local.WriteTrace(0,

new SPDiagnosticsCategory("TravelMaps"

,

TraceSeverity.Unexpected, EventSeverity

.Error),

TraceSeverity

.Unexpected,

ex.Message,

ex.StackTrace);

}

}