GIS
Web Mapping
Using HTML and MS-Access Forms
as your Geographical Information System (GIS)
How to use the output of ICMap with your current
applications. This page describes how to add HTML maps to MSAccess Forms
and how to use the Access Tables to add point, line, text and polygon features to add
interactive mapping
to your current applications and investment.
The process described here can be used by
most windows application (HTML, .NET, C++, VBA, EXCEL, Word, Delphi,...). This approach does not require a web server, the base map (GIF
Files) created
by ICMap can be viewed in Access directly from disk, this means that a lap-top
in the field can run your mapping applications. Note: The base map used in these
examples take @ 10 minutes to create using ICMap.
Example 1
To place points of interest with
hyperlinks and hover-hints on a US map on an MS-Access Form.
Step 1: place a "Microsoft Web Browser" activeX
component on your MS-Access form. (see: Tool Box, More Controls...)
Step 2: add reference - Tools | References |
"Microsoft HTML Object Library"
Step 3: add a "Form Open" event and a "Button Click" event
Show Source Code
|
Private Sub Command1_Click()
Dim win As MSHTML.IHTMLWindow2
Dim link As String
Set win = Me.ActiveXCtl1.Document.parentWindow
link = """Href='http://www.CollinsSoftware.com' Title='Collins Software'"""
win.execScript ("icClear();")
win.execScript ("icSymbol([1," & link & ",-95.58,29.84,0,'blue','star',16])")
win.execScript ("icScale(6);")
win.execScript ("icPosition(-95.58,29.84);")
win.execScript ("icRefresh();")
End Sub
Private Sub Form_Open(Cancel As Integer)
Me.ActiveXCtl1.Navigate ("http://www.CollinsSoftware.com/icmap/ic_usmap/usmap.htm")
End Sub
|
Show
Example 1 as an HTML Document
Download
Access-2000 Example 1
Example 2
This Example is a list of U.S.
Capital Cites and a Map of the U.S., Clicking on a Capital will center the map
on the city
Click HERE to
enlarge
Example 2
Adding a loop through the source Document will generate a
graphic for every row, in this case one for every US capital city.
Show Source Code
|
'=================================================================================
'
Navigate to U.S. Map (On Form Open)
'=================================================================================
Private Sub Form_Open(Cancel As Integer)
Me.ActiveXCtl0.Navigate ("http://www.CollinsSoftware.com/icmap/ic_usmap/usmapIndex.htm")
End Sub
'=================================================================================
'
Place a Star at all Capital Cities
'=================================================================================
Private Sub Map_Click()
Dim win As MSHTML.IHTMLWindow2
Dim doc As MSHTML.IHTMLDocument2
Dim rs As Recordset
Dim X, Y, name
Dim link As String
Dim ID As Long
Dim text
Dim Sel
Me.subformIndex.Form.Visible = True
Me.subformIndex.SetFocus
Me.Map.Visible = False
Set doc = Me.ActiveXCtl0.Document
Set win = doc.parentWindow
link = ""
isMapped = True
win.execScript ("icClear();")
Set rs = Me.RecordsetClone
rs.MoveFirst
Do While (Not rs.EOF)
X = rs("x").Value
Y = rs("y").Value
ID = rs("ID").Value
link = """NoHref Title='" & Trim(rs("City").Value) & ", " & Trim(rs("State").Value) & "'"""
win.execScript ("icSymbol([" & ID & "," & link & "," & X & "," & Y & ",0,'green','star',20])")
rs.MoveNext
Loop
win.execScript ("icScale(8);")
win.execScript ("icRefresh();")
Me.subformIndex.Form.goSelected
End Sub
'=================================================================================
'
Center on Selected Capital (subform function)
'=================================================================================
Public Sub goSelected()
Dim Ident As Long
Dim win As MSHTML.IHTMLWindow2
Dim RX, RY
If (Not isMapped) Then Exit Sub
Ident = Me.ID.Value
RX = Me.X.Value
RY = Me.Y.Value
On Error GoTo done
Set win = Me.Parent.Form.ActiveXCtl0.Document.parentWindow
win.execScript ("icScale(6);")
win.execScript ("icPosition(" & X & "," & Y & ")")
win.execScript ("icRefresh()")
done:
End Sub
|
Show Example 2
as an HTML Document
Download
Access-2000 Example 2
Example 3
Utilizing the web browser technology to enhance the form handling
capabilities of MS-Access.
Click HERE to
enlarge
Adding feedback from the HTML mapping document to the Access Form
allows coordinates and information from the Web map to be used in the editing
and/or creation of rows in the MS-Access tables.
This example returns the location (X/Y) and
property information (first 10 fields) from an On-Line parcel level mapping application back to the Access Application
which stores this information in a Property for Rent Table. The web map
contains a link on 1.2 million parcels, when the user clicks a lot, it will
notify the Access application of the event and supplies it with the x/y, HCAD Account Number, and the Site Address of the lot selected.
Parcel Level editing using MS-Access
to locate and populate basic information from a general purpose Web based
mapping system. Once the Access table is created you can then web publish your
point, line, and polygon features as an overlay to the original web
map.
Again these examples can be
accomplished using HTML or MS-Access, the choice of system will depend on your
application requirements.
Show Example
3 as an HTML Document
Download
Access-2000 Example 3
|