how do i display a dynamic map on my web page using ASP vbscript?...
the map i'm talking about is like a google map where people can interact with it...i've already displayed and interacted with the map using Visual Basic 6.0...but i don't know how to convert the codes on ASP..
this is the code i used on visual basic...i really need to know how to convert this on ASP vbscript.:
Code:Dim vr As New MapObjects2.ValueMapRenderer Dim ptClicked As MapObjects2.POINT Dim lblren As MapObjects2.LabelPlacer Dim mlyr As MapObjects2.MapLayer Dim recs As MapObjects2.Recordset Dim admlyr As MapObjects2.MapLayer Dim adrecs As MapObjects2.Recordset Dim spotrecs As MapObjects2.Recordset Dim capitalize As String Dim ml As New MapObjects2.MapLayer Dim dc As New MapObjects2.DataConnection Dim maprst As New MapObjects2.Recordset Dim gZoomingIn As Boolean Dim gZoomingOut As Boolean Dim buttonstate As Variant Dim Button As Integer Dim ob As Object Dim R As New MapObjects2.LabelPlacer Dim t As New MapObjects2.TextSymbol Set dc = New MapObjects2.DataConnection dc.Database = "C:\Documents and Settings\User\Desktop\GIS\GIS-Remain\Ormoc" dc.Connect Set rs = Retrieve("Select * from tblmaplayerproperty") Do While Not rs.EOF Select Case rs.Fields("LayerName").Value 'Load data to the map Case "BarangayPoly" Set ml = New MapObjects2.MapLayer ml.GeoDataset = dc.FindGeoDataset("brgy_poly") ml.Name = "Barangay Poly" ml.Symbol.Color = rs("SymbolColor").Value 'RGB(255, 255, 230) ml.Symbol.OutlineColor = rs("OutlineColor").Value ml.Symbol.Size = rs("Symsize").Value Map1.Layers.Add ml Set maprst = ml.Records i = 0 With vr .ValueCount = maprst.Count maprst.MoveFirst Do While Not maprst.EOF .Field = "Brgyname" .Value(i) = maprst("Brgyname") .SymbolType = moFillSymbol .Symbol(13).Color = &H8000& maprst.MoveNext i = i + 1 Loop End With Set Map1.Layers(0).Renderer = vr Case "ormoc_river" Set ml = New MapObjects2.MapLayer ml.GeoDataset = dc.FindGeoDataset("ormoc_river") ml.Name = "River" ml.Symbol.Color = rs("SymbolColor").Value ml.Symbol.Size = rs("Symsize").Value Map1.Layers.Add ml Case "ormoc_roads" Set ml = New MapObjects2.MapLayer ml.GeoDataset = dc.FindGeoDataset("ormoc_roads") ml.Name = "Roads" ml.Symbol.Color = rs("SymbolColor") ml.Symbol.SymbolType = moSolidLine ml.Symbol.Size = rs("Symsize").Value Map1.Layers.Add ml Case "ormocspot" Set ml = New MapObjects2.MapLayer ml.GeoDataset = dc.FindGeoDataset("ormoc_spot") ml.Name = "ormoc spot" ml.Symbol.Color = rs("SymbolColor").Value ml.Symbol.Style = rs("Style").Value ml.Symbol.Size = rs("Symsize").Value ml.Symbol.OutlineColor = rs("OutlineColor").Value Map1.Layers.Add ml Case "accommodation" Set ml = New MapObjects2.MapLayer ml.GeoDataset = dc.FindGeoDataset("accomodation") ml.Name = "Accommodation" ml.Symbol.Color = rs("SymbolColor").Value ml.Symbol.Style = rs("Style").Value ml.Symbol.Size = rs("Symsize").Value ml.Symbol.OutlineColor = rs("OutlineColor").Value Map1.Layers.Add ml Case "dining" Set ml = New MapObjects2.MapLayer ml.GeoDataset = dc.FindGeoDataset("dining") ml.Name = "Dining" ml.Symbol.Color = rs("SymbolColor").Value ml.Symbol.Style = rs("Style").Value ml.Symbol.Size = rs("Symsize").Value ml.Symbol.OutlineColor = rs("OutlineColor").Value Map1.Layers.Add ml Case "health_wellness" Set ml = New MapObjects2.MapLayer ml.GeoDataset = dc.FindGeoDataset("health_wellness") ml.Name = "Health and Wellness" ml.Symbol.Color = rs("SymbolColor").Value ml.Symbol.Style = rs("Style").Value ml.Symbol.Size = rs("Symsize").Value ml.Symbol.OutlineColor = rs("OutlineColor").Value Map1.Layers.Add ml Case "hospital" Set ml = New MapObjects2.MapLayer ml.GeoDataset = dc.FindGeoDataset("hospital") ml.Name = "Ormoc Hospital" ml.Symbol.Color = rs("SymbolColor").Value ml.Symbol.Style = rs("Style").Value ml.Symbol.Size = rs("Symsize").Value ml.Symbol.OutlineColor = rs("OutlineColor").Value Map1.Layers.Add ml Case "travel_agencies" Set ml = New MapObjects2.MapLayer ml.GeoDataset = dc.FindGeoDataset("travel_agency") ml.Name = "Travel Agencies" ml.Symbol.Color = rs("SymbolColor").Value ml.Symbol.Style = rs("Style").Value ml.Symbol.Size = rs("Symsize").Value ml.Symbol.OutlineColor = rs("OutlineColor").Value Map1.Layers.Add ml Case "shopping_mall" Set ml = New MapObjects2.MapLayer ml.GeoDataset = dc.FindGeoDataset("ShoppingMall") ml.Name = "Malls" ml.Symbol.Color = rs("SymbolColor").Value ml.Symbol.Style = rs("Style").Value ml.Symbol.Size = rs("Symsize").Value ml.Symbol.OutlineColor = rs("OutlineColor").Value Map1.Layers.Add ml Case "bank" Set ml = New MapObjects2.MapLayer ml.GeoDataset = dc.FindGeoDataset("bank") ml.Name = "Bank" ml.Symbol.Color = rs("SymbolColor").Value ml.Symbol.Style = rs("Style").Value ml.Symbol.Size = rs("Symsize").Value ml.Symbol.OutlineColor = rs("OutlineColor").Value Map1.Layers.Add ml Case "ormoc_hospitals" Set ml = New MapObjects2.MapLayer ml.GeoDataset = dc.FindGeoDataset("ormochlthcntr") ml.Name = "Ormoc Health Center" ml.Symbol.Color = rs("SymbolColor").Value ml.Symbol.Style = rs("Style").Value ml.Symbol.Size = rs("Symsize").Value Map1.Layers.Add ml ' RGB(255, 255, 230) Case "Barangay" Set ml = New MapObjects2.MapLayer ml.GeoDataset = dc.FindGeoDataset("Barangay") ml.Name = "Baranggay" ml.Symbol.Color = rs("SymbolColor").Value ml.Symbol.Style = rs("Style").Value ml.Symbol.Size = rs("Symsize").Value ml.Symbol.OutlineColor = rs("OutlineColor").Value Map1.Layers.Add ml Dim oFont As New StdFont oFont.Name = "Calibri" oFont.Size = 8 'oFont.Bold = True R.ValueCount = ml.Records.Count Set R.DefaultSymbol.Font = oFont R.Field = "BRGYNAME" Set R.Symbol(0).Font = oFont R.AllowDuplicates = True R.PlaceAbove = True Set Map1.Layers(0).Renderer = R End Select rs.MoveNext Loop




Reply With Quote
Bookmarks