Chapter 14: Line and Polygon Examples

From Mapping in the Cloud by Michael Peterson

Assignments from (insert your name here)


All Google Maps API examples here use a key that is assigned to a specific server. 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.


Lines

  1. 14_01a_Simple_Line - Draw a line that shows your general route home.
  2. 14_01b_Dashed_line - Draw a dashed line between two points.
  3. 14_01c_Arrow - Draw an arrow between two points.
  4. 14_01d Route_Line - Change the title, points, description, and size.
  5. 14_03a_Geodesic_Line - Make a single map that shows the great circles between three major cities in the world.
  6. 14_03b_Great_Circle_input - Modify the color and thickness of the resultant line.
  7. 14_04_Mapping_lines_from_an_XML_file - Enter new points and infowindow text in the "example.xml" file.
  8. 14_05a_Mapping_lines_from_JSON_file - Modify the "SW.json" file. Map may not display properly in Dreamweaver.
  9. 14_05b_Mapping_lines_from_geoJSON_file - Create a new line and display.
  10. 14_10_Cross_section - Make a cross-section that is perpendicular to a mountain or river valley.
  11. 14_12a_Route_Line - Create a route that connects two places.
  12. 14_12b_Route_Choice - Create a route that connects two places.
  13. 14_12c_Draggable_Distance - Create a route that connects four places.

Extra Credit:
14_02_Flow_Map - Map out data on the number of people that fly between three different airports. Data can be found through this List of busiest passenger air routes. Make the thinnest line 2 pixels and the thickest 20 pixels wide . Include the calculated widths of the lines below the map.
14_06a_Mapping_lines_from_KML_file.htm
- Change the coordinates for the line in the kml_lines.kml file. Change the address of the kml_lines.kml file so that it points to your directory. It should not point to the maps.unomaha.edu server.
14_06b_Mapping_flight_track_great_circle.htm - Map out a flight track between two cities and the corresponding great circle route.
14_08c_Mapping_flight line from a geoJSON file - Upload the data from 14.06b to http://geojson.io using Open/File. Download (Save) as geoJSON. Link to this file. May not display in Dreamweaver.
14_09_Line_Input - Change the center, line width and line color of the line that is drawn.
14_11_Polyline_Encoding.htm - Encode a line segment and map the line by copying and pasting the encoded polyline into the following code: 14_11a_Display_Encoded_Polyline.htm

Other line examples:
14_03b_Great_Circle_input - Modify the color and thickness of the resultant line.
14_10a_Elevation service - Change location and size of map. Add feet to the infowindow. Add title.


Areas

  1. 14_13a_Single_polygon - Change center and create a polygon and fill with a different color
  2. 14_14_Mapping_polygon_from_XML_file.htm - Create a new polygon and change the center and polygon color.
  3. 14.22c2_Nebraska_Unclassed_Blue_Exponent - Change to red or green colors.
  4. 14_22d_Display_World_GeoJSON - Change scale and size of map.
  5. 14_22e_Display_US_GeoJSON - Display another geoJSON file.
  6. 14_22h_Display_US_County_TOPOjson - Change scale and size of map.
  7. 14.22i_Choropleth_map_from_geoJSON - Change the variable mapped using instructions within the code.
  8. 14.22l_Choropleth_map_from_topoJSON - Change the variable mapped using instructions within the code.

Extra credit
Create a cross-section from Los Angeles to New York.
Convert a shapefile of a state outline to a KML file using the mygeodata converter.
14_15_inside_Polygon_Vienna.html - Create another donut polygon.
14_16_Inside_KML_Polygon.html - Create a new donut polygon in the kml_polygons.kml, change the center and polygon color.
14_22a_Nebraska_Unclassed Choropleth_Opacities.html - Find data for Nebraska by county. Copy and paste the data into an Excel spreadsheet. Add a comma after each value using concatenate. Create a single string of comma-delimited values by using the transpose option. This is done by copying the column of data and using the transpose option to paste. Paste options are available under the arrow next to Paste in the Home tab.
14_22b_Nebraska_Unclassed_Grey - Uses grey shades between 0-255 defined with identical r,g,b values. Display same data as previous example.
14_22c_Nebraska_Unclassed_Grey_Exponent - The perception of grey shades is underestimated so an exponent is applied here to modify shadings. Display same data as previous example.

Other area examples:

14_13b_Draggable_polygon - Change center to a more northerly location and create a polygon with 4 points and fill with a different color.
14_13c_Point_in_Polygon - Change center and create a polygon and fill with a different color.
14_22f_Click_Style_GeoJSON - Change color and size.
14_22g_Display_California_TOPOjson - Change scale and size of map.


Back to my assignments page