VOCWiki:BCMap

From VOC Wiki
Jump to: navigation, search

BCMap Extension

There's a custom mediawiki extension on VOCWiki which allows one to embed a map from BC Basemap.

Usage

To use this feature, write something like this in a wiki page <bcmap>lat=50.1|long=123.2</bcmap>. You must specify the center of the map using (lattitude and longitude) OR you can specify the bounding box of the map using (north and south and east and west) parameters.

Additionally, there are some optional paramaters :

  1. height: height of the map in km (default:10km)
  2. width: width of the map in km (default:10km)
  3. scale: map scale in pixels / km (default:100 pixels/km) - note that 105 pixels/km is the minimum to get 20m contour lines
  4. linkscale: when you click on the map you'll be shown an image with this scale (default:2*scale)
  5. alttext: what text-only web browsers will see instead of the map (default:BC Basemap)
  6. interactive: set it =1 to get an interactive map using OpenLayers (default: 0)
  7. markerlong, markerlat: position a marker at this location (only works with interactive map at the moment)

Example

<bcmap>lat=49.9|long=123.0|scale=105|width=8|height=4</bcmap> gives this: <bcmap>lat=49.9|long=123.0|scale=105|width=8|height=4</bcmap>

Interactive Example

Interactive map of the location of the Burton Hut. Note that you can zoom/pan just like when using Google Maps. You can also switch to Google Maps Satellite imagery by using the "+" sign on the right. <bcmap>lat=49.92|long=123.0|scale=200|width=4|height=2|interactive=1|markerlong=122.988338|markerlat=49.928337</bcmap> <bcmap>lat=49.92|long=123.0|scale=200|width=4|height=2|interactive=1|markerlong=122.988338|markerlat=49.928337</bcmap>

Advanced Usage

You can control the layers by using the following optional parameters:

  1. addlayers: comma separated list of additional layers to activate
  2. removelayers: comma seperated list of layers to deactivate

The layers names appear to be treated in a case sensitive fashion by the map server. So we do the same in the extension. Make sure you get he capitalization correct.

List of default layers:

DBM_7H_MIL_BATHYMETRIC_POLY DBM_7H_MIL_POLITICAL_POLY_BC DBM_7H_MIL_POLITICAL_POLY_PS DBM_7H_MIL_PARK_POLY DBM_7H_MIL_ROADS_LINE DBM_7H_MIL_DRAINAGE_POLY DBM_7H_MIL_DRAINAGE_LINE DBM_7H_MIL_BOUNDARIES_LINE DBM_7H_MIL_POPULATION_POINT BC_WATER_POLYS_5KM BC_BASEMAP_LINES_5KM_WATER BC_BASEMAP_LINES_5KM_TRANSPORT BC_BASEMAP_LINES_5KM_BOUNDARY BC_RIV_LAKE_WET_POLYS_500M BC_WATER_LINES_500M BC_TRANSPORT_LINES_500M BC_PROV_BOUNDARIES_LINES_500M BC_MANMADE_LINES_500M BC_MAJOR_CITIES_POINTS_500M BC_WATER_POINTS_500M BC_TRANSPORT_POINTS_500M BC_SPOT_ELEVATION_POINTS_500M BC_MANMADE_POINTS_500M BC_ANNOTATION_500M NTS_BC_COASTLINE_POLYS_125M NTS_BC_RIV_LAKE_WET_POLYS_125M NTS_BC_COASTLINE_LINES_125M NTS_BC_CONTOUR_LINES_125M NTS_BC_LANDCOVER_LINES_125M NTS_BC_LANDFORM_LINES_125M NTS_BC_MANMADE_LINES_125M NTS_BC_TRANSPORT_LINES_125M NTS_BC_WATER_LINES_125M NTS_BC_MANMADE_POINTS_125M NTS_BC_TRANSPORT_POINTS_125M NTS_BC_WATER_POINTS_125M NTS_BC_LANDFORM_POINTS_125M NTS_BC_ANNO TRIM_EBM_OCEAN TRIM_EBM_WATERBODIES TRIM_EBM_WATERCOURSES TRIM_EBM_WETLANDS TWTR_LINES TTRN_LINES TSRF_LINES TMISC_LINES TCVR_LINES TCVR_POINTS TCUL_LINES TCTR_LINES TWTR_POINTS TTRN_POINTS TSRF_POINTS TMISC_POINTS TCUL_POINTS TCTR_POINTS TTXT_ANNO TWTR_ANNO TTRN_ANNO TSRF_ANNO TMISC_ANNO TCVR_ANNO TCUL_ANNO TCTR_ANNO DRA_DIGITAL_ROAD_ATLAS_LINE_SP

Additional list of layers available (this is a complete list, taken from this XML file):

TCTR_ANNO BCGS_10K_GRID BCGS_20K_GRID BCGS_20K_GRID_OFFSET NTS_50K_GRID NTS_250K_GRID NTS_250K_GRID_OFFSET

Example

<bcmap>lat=49.9|long=123.0|scale=100|width=8|height=4|addlayers=BCGS_GRID,TRSF_ANNO|removelayers=TRIM_EBM_WATERBODIES,TRIM_EBM_WATERCOURSES</bcmap> gives this: <bcmap>lat=49.9|long=123.0|scale=100|width=8|height=4|addlayers=BCGS_GRID,TRSF_ANNO|removelayers=TRIM_EBM_WATERBODIES,TRIM_EBM_WATERCOURSES</bcmap>

For information on available layers, see online mapping#Provincial Basemap WMS

Current Issues

The projection used for the interactive map is "bad". We should use something like BC Albers. If someone can provide me the function to translate BC Albers to/from lat/lon it will be possible.