Map1.MapBackground.BackgroundBrush = New GeoSolidBrush(GeoColor.FromArgb(255, 242, 239, 233)) Map1.MapUnit = GeographyUnit.DecimalDegree Map1.MapTools.LoadingImage.Enabled = False Map1.MapTools.KeyboardMapTool.Enabled = False Map1.MapTools.MiniMap.Enabled = False Map1.MapTools.ScaleLine.Enabled = False Map1.MapTools.MouseCoordinate.Enabled = True Map1.MapTools.PanZoomBar.Enabled = False Map1.MapTools.MouseMapTool.Enabled = False Map1.MapTools.Logo.ImageUri = New Uri(ConfigurationManager.AppSettings("Path") + "images/tfmaplogo.png") Dim geoCodeSettings As New GeoCodeUSASettings Dim istr As Integer = 0 Dim geoCodeResult As GeoCodeResult = GetPositionFromAddress(Address, City, State, ZipCode, istr) If (geoCodeResult.Longitude = 0 And geoCodeResult.Latitude = 0) Then Map1.Visible = False rptergdview.Visible = False Else rptergdview.Visible = True Map1.Visible = True End If Dim dd As String = "" dd = Guid.NewGuid.ToString() Map1.CustomOverlays.Clear() Dim google As New GoogleOverlay(dd) google.JavaScriptLibraryUri = New Uri(ConfigurationManager.AppSettings("GoogleUri")) google.GoogleMapType = GoogleMapType.Normal Map1.CustomOverlays.Add(google) Dim markerOverlay As New SimpleMarkerOverlay(Guid.NewGuid.ToString()) Dim xInDecimalDegree As Double = 0 Dim yInDecimalDegree As Double = 0 Dim fromPoint As PointShape = New PointShape(geoCodeResult.Longitude, geoCodeResult.Latitude) Dim proj4 As New Proj4Projection() proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326) proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString() proj4.Open() Dim vertexInGoogleProjection As Vertex = proj4.ConvertToExternalProjection(geoCodeResult.Longitude, geoCodeResult.Latitude) proj4.Close() markerOverlay.Markers.Add(GetMarker(vertexInGoogleProjection.X, vertexInGoogleProjection.Y, "c1", "", contentHtml.ToString, -1, -1)) Private Function GetMarker(ByVal x As Double, ByVal y As Double, ByVal number As String, ByVal UserID As String, ByVal contentHtml As String, ByVal isfav As Integer, ByVal ifree As Integer) As Marker Dim valueMarkerStyle As New ValueMarkerStyle("id") Dim webImage As New WebImage("marker.png", 0, 0, 0, 0) 'If CheckIfFavorite(UserID) Then If number = "c1" Then webImage = New WebImage("images/house.png") ', 26, 26) webImage.Text = "" ElseIf number = "c2" Then webImage = New WebImage("images/building.png") ', 26, 26) webImage.Text = "" Else If (isfav = 1) Then webImage = New WebImage("images/icons/" + Session("SpecialityText") + ".gif", 30, 30) If (number < 9) Then webImage.TextOffsetX = 8 webImage.TextOffsetY = 6 Else webImage.TextOffsetX = 5 webImage.TextOffsetY = 6 End If Else If (ifree = 1) Then webImage = New WebImage("images/icons/" + Session("SpecialityText") + "-paid.gif", 20, 20) Else webImage = New WebImage("images/icons/" + Session("SpecialityText") + "-free.gif", 16, 16) End If If (number < 9) Then webImage.TextOffsetX = 3 webImage.TextOffsetY = 1 Else webImage.TextOffsetX = -1 webImage.TextOffsetY = 0 End If End If ' webImage = New WebImage("images/marker_green.gif", 21, 25) webImage.Text = number End If Dim marker As New Marker(x, y, webImage) marker.Popup.ContentHtml = contentHtml.ToString() marker.Popup.Width = 190 marker.Popup.Height = 50 marker.Popup.AutoPan = True marker.Popup.IsVisible = False webImage.FontColor = GeoColor.StandardColors.White webImage.FontStyle = New GeoFont("Arial", 10, DrawingFontStyles.Bold) If number = "c" Then webImage.TextOffsetX = 4 webImage.TextOffsetY = 0 webImage.FontColor = GeoColor.StandardColors.Black End If Return marker End Function