Dear Gary,
Thanks for Reply.
What is the format of Meter Map data. Please give example. Can I convert my cordinate data as per google map required format, becuase I set the projection and still, its not supporing.
Dim latitude As Double
Dim longitude As Double
Dim FileName As String = RootFolderName & "\Images\Aqua.png"
Dim winformsMap1 As WinformsMap = DirectCast(Me.WinformsMap1, WinformsMap)
Dim pointLayer As InMemoryFeatureLayer = Nothing
Dim txtLatitude As String = "27.13102"
Dim txtLongitude As String = "78.00735"
latitude = Convert.ToDouble(txtLatitude, CultureInfo.InvariantCulture)
longitude = Convert.ToDouble(txtLongitude, CultureInfo.InvariantCulture)
pointLayer = DirectCast(winformsMap1.FindFeatureLayer("PointLayer"), InMemoryFeatureLayer)
Dim proj4 As Proj4Projection = New Proj4Projection
proj4.InternalProjectionParametersString = ManagedProj4Projection.GetEpsgParametersString(4326)
proj4.ExternalProjectionParametersString = ManagedProj4Projection.GetGoogleMapParametersString()
Try
If pointLayer Is Nothing Then
pointLayer = New InMemoryFeatureLayer
pointLayer.Open()
pointLayer.Columns.Add(New FeatureSourceColumn("ID"))
pointLayer.Close()
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.PointType = PointType.Bitmap
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.Image = New GeoImage(FileName)
pointLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
Dim dynamicOverlay As New LayerOverlay()
dynamicOverlay.Layers.Add("PointLayer", pointLayer)
dynamicOverlay.IsBase = False
winformsMap1.Overlays.Add("PointOverlay", dynamicOverlay)
End If
Catch ex As KeyNotFoundException
pointLayer = New InMemoryFeatureLayer
pointLayer.Open()
pointLayer.Columns.Add(New FeatureSourceColumn("ID"))
pointLayer.Close()
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.PointType = PointType.Bitmap
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.Image = New GeoImage(FileName)
pointLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
Dim dynamicOverlay As New LayerOverlay()
dynamicOverlay.Layers.Add("PointLayer", pointLayer)
dynamicOverlay.IsBase = False
winformsMap1.Overlays.Add("PointOverlay", dynamicOverlay)
Finally
SearchId = SearchId + 1
Dim feature As New Feature(longitude, latitude, SearchId)
feature.ColumnValues.Add("ID", SearchId)
pointLayer.InternalFeatures.Add(SearchId, feature)
pointLayer.FeatureSource.Projection = proj4
winformsMap1.CenterAt(New PointShape(longitude, latitude))
winformsMap1.Refresh(winformsMap1.Overlays("PointOverlay"))
End Try
Please reply.
Regards
Sanjay