VDS Technologies

 

Adding Image ECW problem overlay with Google.

8/26/2012 2:28:19 PM
Total Posts 50

Adding Image ECW problem overlay with Google.

Hello,

 

I need your help. 

How to add Image ECW become the same projection with Googlemap? I have tried with this code but the image not appears. See on "Protected Sub ChklayerImages2010(ByVal map As AspMap.Web.Map)".

The rest is Ok. but when i load image ECW, it doesn't appears.

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' add a TileLayer to the map
'AddGoogleMapsLayer()
TilelayerPilih()
'AddTileLayer()
'AddmapLayer()

' set the map units
map.MapUnit = AspMap.MeasureUnit.Degree

' initialize the ScaleBar
map.ScaleBar.Visible = True
map.ScaleBar.BarUnit = UnitSystem.Metric
map.ScaleBar.KilometersString = "km"
map.ScaleBar.MilesString = "Miles"

map.ScaleBar.MetersString = "meter"

' initialize the ZoomLevels collection

map.ZoomLevels.Add(110000)
map.ZoomLevels.Add(100000)
map.ZoomLevels.Add(55000)
map.ZoomLevels.Add(50000)
map.ZoomLevels.Add(45000)
map.ZoomLevels.Add(35000)
map.ZoomLevels.Add(30000)
map.ZoomLevels.Add(25500)
map.ZoomLevels.Add(20500)
map.ZoomLevels.Add(14250)
map.ZoomLevels.Add(10250)
map.ZoomLevels.Add(7250)
map.ZoomLevels.Add(5125)
map.ZoomLevels.Add(3562)
map.ZoomLevels.Add(250)
map.ZoomLevels.Add(25)
map.ZoomLevels.Add(5)

'map.CoordinateSystem = New AspMap.CoordSystem(AspMap.CoordSystemCode.PCS_WGS84UTM_48N)
' enable the transparency of the main map image to show tile images from tile layers
map.ImageFormat = AspMap.ImageFormat.Png
map.ImageOpacity = 0
' map.ImageOpacity = 0

AddMarkLay(map)

If Not IsPostBack Then
map.CenterAt(map.CoordinateSystem.FromWgs84(104.02961999999999, 1.091216))
map.ZoomLevel = 13
BindRepeaterData()
End If

End Sub

Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender

ChklayerImages2010(map)
ChklayerImages2006(map)

End Sub

Protected Sub TilelayerPilih()

' You have to sign up for a Maps API key at http://code.google.com/apis/maps/signup.html.

Dim gml As GoogleMapsLayer = New GoogleMapsLayer()

gml.MapType = GoogleMapType.Satellite

' When a GoogleMapsLayer object is set as a background layer: 1) the coordinate system of the
' Map control will be set to PCS_PopularVisualisationMercator; 2) 20 zoom levels
' from Google Maps will be added to the ZoomLevels collection of the Map control;
' 3) the FullExtent property of the Map control will be set to the full extent of Google Maps.

map.BackgroundLayer = gml

gml.Visible = False

If CheckGoogle.Checked = True Then
gml.Visible = True
map.ImageOpacity = 0.80000000000000004
addmaplayeroverlay()
' addlayerRoadfull(map)
Else
gml.Visible = False

map.RemoveAllLayers()
AddmapLayer()
'map.ImageOpacity = 0.2
'addlayerRoad(map)
End If

End Sub

 

Protected Sub ChklayerImages2010(ByVal map As AspMap.Web.Map)

Dim layerImageFolder2010 As String = MapPath("MAPS/Images/2010/")
Dim layerImageFolder2006 As String = MapPath("MAPS/Images/2006/")

If Satellit2010.Checked = True Then
map.RemoveAllLayers()
Dim layer As AspMap.Layer = map.AddLayer(layerImageFolder2010 & "QB_2010_LL.ecw")
'map.AddLayer(layerImageFolder2010 & "QB_2010_LL.ecw")
layer.CoordinateSystem = New AspMap.CoordSystem(AspMap.CoordSystemCode.GCS_WGS84)

'addlayerRoadfull(map)

Else
map.RemoveLayer(layerImageFolder2010 & "QB_2010_LL.ecw")

End If

End Sub

8/28/2012 9:24:32 AM
MVP
Total Posts 323

Re: Adding Image ECW problem overlay with Google.

Your ECW file must have the same coordinate system as Google Maps, otherwise it will be displayed incorrectly. This belongs to all raster maps.