I have a GeoCoding demo application that has been running fine until this morning. All of a sudden I cannot zoom without it lagging and my search "Match" function creates the marker point however the map is shown blank after going to that coordinate.
As I mentioned there were no code changes made since yesterday however it is not working now.
What could cause this issue?
Below is my code for my map configuration.
mapCtrl.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFitmapCtrl.MapResizeMode = MapResizeMode.PreserveScaleAndCenter
mapCtrl.MapUnit = GeographyUnit.DecimalDegreemapCtrl.BackgroundOverlay.BackgroundBrush =NewGeoSolidBrush(GeoColor.GeographicColors.ShallowOcean)mapCtrl.CurrentExtent =NewRectangleShape(-75.412903, 41.409776, -73.979187, 38.826871)
simpleMarkerOverlay =NewSimpleMarkerOverlay()simpleMarkerOverlay.MapControl = mapCtrl
simpleMarkerOverlay.DragMode = MarkerDragMode.Drag
mapCtrl.Overlays.Add("WMK",NewWorldMapKitWmsDesktopOverlay())mapCtrl.Overlays.Add("SimpleMarker", simpleMarkerOverlay)
mapCtrl.Refresh()
Here is my match function code:
DimdataPathAsString="L:\SQLite_Databases\MapSuiteGeoCoderFullData"
DimresultsAsSystem.Collections.ObjectModel.Collection(Of GeocoderMatch)DimusaGeocoderAsNewUsaGeocoder(dataPath, MatchMode.ExactMatch, StreetNumberMatchingMode.ExactMatch)
TryusaGeocoder.Open()IfMe.txtZipcode.Text.Trim =""Thenresults = usaGeocoder.Match(Me.txtAddress.Text,Me.txtCity.Text,Me.txtState.Text)Elseresults = usaGeocoder.Match(Me.txtAddress.Text,Me.txtZipcode.Text)EndIfFinallyusaGeocoder.Close()EndTry
simpleMarkerOverlay.Markers.Clear()mapCtrl.Controls.Clear()
DimmultiPointShapeAsNewMultipointShape()DimmatchStringAsString=If(SearchType = GeocoderSearchType.Street,"Street",String.Empty)DimsearchResultItemsAsNewSystem.Collections.ObjectModel.Collection(Of GeocoderMatch)()
DimaddressAsString=Me.txtAddress.Text
DimstreetParts()AsString= address.Split(NewChar() {" "c})
DimhouseNumberAsIntegerForEachhousePartAsStringInstreetPartsIfIsNumeric(housePart)ThenhouseNumber =CInt(housePart)ExitForEndIfNext
ForEachitemAsGeocoderMatchInresultsIfString.IsNullOrEmpty(matchString)OrElseitem.NameValuePairs.ContainsKey(matchString)ThenIf(item.NameValuePairs("CityAlias").Trim =Me.txtCity.Text.TrimOritem.NameValuePairs("Zip").Trim =Me.txtZipcode.Text.Trim)And_((houseNumber >=CInt(item.NameValuePairs("FromAddressLeft"))AndhouseNumber <=CInt(item.NameValuePairs("ToAddressLeft")))And_(houseNumber >=CInt(item.NameValuePairs("FromAddressRight"))AndhouseNumber <=CInt(item.NameValuePairs("ToAddressRight"))))ThenAddSearchResultMarkerWithToolTip(item, multiPointShape)searchResultItems.Add(item)EndIfEndIfNext
UpdateResultListView(searchResultItems)
IfmultiPointShape.Points.Count > 0ThenmapCtrl.CurrentExtent = multiPointShape.GetBoundingBox()EndIf
mapCtrl.Refresh()
and my code to zoom to the found marker point:
DimdataGridAsDevExpress.XtraGrid.Views.Grid.GridView = TryCast(sender, DevExpress.XtraGrid.Views.Grid.GridView)DimtagAsBaseShape = BaseShape.CreateShapeFromWellKnownData(TryCast(Me.gvResults.GetRowCellValue(e.FocusedRowHandle,"CentroidPoint"),String))mapCtrl.CurrentExtent =DirectCast(tag, BaseShape).GetBoundingBox()mapCtrl.Refresh()Me.txtLatitude.EditValue = TryCast(Me.gvResults.GetRowCellValue(e.FocusedRowHandle,"FromLatitude"),String)Me.txtLongitude.EditValue = TryCast(Me.gvResults.GetRowCellValue(e.FocusedRowHandle,"FromLongitude"),String)EndSub
As I mentioned, nothing has changed in my code over the last 24 hours. Could it be an issue with the GeoCoder database indexes?