Linking to Weather Data From MapPoint
Chris Gebhardt shows how to link to web-based geographical data from within MapPoint
In some circumstances, users will want to access a website that is
based on Zip code information or maybe City information. For example, you could
write an application that allows a user to select a place on the map using their
mouse and then click a button to find out information about that City in a
web browser. For this example, we will use weather forecasts. The problem
statement is easy, "What is the weather at zip code XXXXX?"
Create a new Standard EXE application in Visual Basic. On Form1, add a
MapPoint Control called MPC1, a Web Browser control called WB1, and a command
button called cmdWeather. (The Web Browser control is "hidden" inside the
Microsoft Internet Controls components!) Now, add the following code:
As you can see, this code is very simplistic and only represents one
way to achieve a solution to the problem statement of "What is the weather at
ZIP code XXXXX?" You could create a COM add-in that will appear on the MapPoint
pop-up menu or even replace the default MapPoint pop-up window when a user
clicks on the map.
A word of caution: You will want to make sure the URL use is safe and
you are not violating any copyright or licensing laws.
Chris is a former Lieutenant with the Metropolitan Police Department in Washington, D.C. where he was the Commander of the Tactical
Crime Analysis Unit responsible for crime analysis and crime mapping. This job is the basis for the TV show "The District."
In his spare time, Chris is the Technical Advisor to the California Crime and Intelligence Analysts Association