Chapter 12: Point Mashups with Google Maps

All Google Maps API examples here use a key that is assigned to a specific server. You may need to acquire your own key. If the Google Map examples below don't work once you upload them to your server, you will need to get your own key from Google. As of July 2018, the Google key requires that you enter a credit card. The first $200 of usage is free. This equates to about 28,000 maps a month, more than most developers would need.

12.02 - Icons: Change the icon by referencing a different icon in the Markers folder. Icons. Change map size and location.

12.04 - Random markers: Change the location so that the border between Nebraska and Iowa is roughly in the middle of the box. To make the box, coordinates need to be defined for the southwest (slat, wlong) and northeast corners (nlat, elong). Change the size of the map. Increase the number of markers to a value between 10 and 99.

JSON is the emerging standard for supplying geographic data feeds. The USGS makes feeds available in this format through USGS JSON Earthquake Feeds12.09c - JSON Earthquake Markers - Change the earthquake display based on different data available from the USGS site (intensity, hourly, daily, weekly, monthly).12.09d - JSON Earthquake Circles - Change the earthquake display based on different data available from the USGS site (intensity, hourly, daily, weekly, monthly).12.09e - JSON Earthquake Shaded - Change the earthquake display based on different data available from the USGS site (intensity, hourly, daily, weekly, monthly).

KML Examples: 12.10a - Ski-Jumping in Canada | 12.10b - Nuclear Power Japan - Change these two examples with other KML feeds. Weather related KML/KMZ feeds are available through NOAA. Copy link location (right-mouse click) for a link that ends in KML or KMZ. Replace the feed address in the code. Adjust view as appropriate. Change map size.

Making your own KML file: 12.11 - KML file with three points - Change the "three_points" KML file to show three other points.
Change the address of the KML file to your server. Change map size and center. Locations are provided in KML in reverse order - longitude and then latitude. Note: This example will not display locally. It must be uploaded to the website before the KML file will be displayed.

KML file with your own icon: 12.12 - KML Three points with icon - Change the "three_points" KML file to show three other points and another icon.
Change the address of the KML file to your server. Change map size. Locations are provided in KML in reverse order - longitude and then latitude. Note: This example will not display locally. It must be uploaded to the website before the KML file will be displayed.

Mapping an openly available Fusion Table - 12.13 - Fusion Table Crime - Find a different public FusionTable with integrated map through the Fusion Table search page. The Fusion Table can only display a map if it contains latitude/longitude values, integrates KML, or has street addresses. Change map size.

Selecting which points to include on the map using SQL - 12.14 - Fusion Table with SQL - SQL (Structured Query Language) is used to change which records to display from a Fusion Table Change ridership number and map size.

12.16 - Flight Track from Minneapolis to Puerto Vallarta - Map a flight track between two other cities. 1) Choose a flight that has arrived between two cities with FlightAware Flight Finder; 2) Under "track log & graph," copy the table of data and paste into Excel. A tracklog consists of the actual and estimated positions of aircraft. Estimations are made when the plane does not have contact with a receiver on the ground.; 3) Delete unneeded columns and create an Excel file of just latitude and longitude;
4) Save and upload the Excel file to a Fusion Table; 5) Specify the two columns as signifying location within the Fusion Table; 6) Share your Fusion Table so that you can have access; 7) Check your map in the Fusion Table to make sure it displays the route properly; 8) Get the address in the File/About option; 9) Replace the address of the Fusion Table in the code; 10) Change map size.

12.17 - Fusion Table based on KML file - Make a Fusion Table with this KML file (use right-mouse click Save Link As ...) that shows a flight between Los Angeles and Newark. Share your Fusion Table so that you can have access. Get the address in the File/About option. Replace the address of the Fusion Table in the code. Change map size.

12.18 - Geocoder - Enter another address in the code so that it will be the default location of the map.

12.19 - Omaha Murders Fusion Table - Enter at least 5 comma-delimited street addresses into a single column of a spreadsheet and upload to a Fusion Table. Title the column "Location". Within Fusion Tables, specify the column as Location data through the drop-down menu next to the Location title. Change map size.