Skip to content

Simple Map Kit and SMK Editor FAQs

Nicole de Greef edited this page Jan 12, 2021 · 10 revisions

What is NodeJS and why do I need it?

Node JS is a JavaScript runtime built on Chrome's V8 JavaScript engine. The smk-cli tool is written in Javascript, and needs the NodeJS runtime in order to run on your machine.

What is the difference between SMK and the SMK-CLI products?

SMK is the Javascript library that provides the map functions. It runs in the browser, as part of a webpage. SMK always needs to be started with a configuration, telling it what layers and tools to show the user.

SMK-CLI is a tool for constructing this configuration and testing it via the SMK Editor. SMK-CLI can also create a new skeleton web page to start a new application.

Do I need to write code to make a map with SMK?

The SMK includes many web mapping features. If out of the box functionality is sufficient to your business/end user needs then you do not have to write code. The SMK Editor will create all code that is required to run a map.

Do I need to be a web developer to make a map with SMK?

The creation of a map using the SMK Editor requires little to no code writing skills whatsoever. However, what is created will need to be stored somewhere in order to maintain and possibly deploy it to a hosting environment. Code management skills (experience with GitHub or similar) are beneficial in taking what you've created to a Production state.

Can I write code for the Simple Map Kit?

Yes - the SMK is an open source project hosted in GitHub under the Apache 2.0 license. We welcome constructive input from anyone and code contributions from the Developer Community.

Can I write code for a map I've created?

Yes - configuration files, HTML, and Javascript can be modified to customize what the SMK Editor created for you. Caveat: significant changes may not be interpreted well by the SMK Editor. Once you start down this path you are leaving the Editor realm and entering Experienced Developer territory - proceed with caution!

What functionality is included in the SMK?

SMK supports the consumption of the following types of data access: ESRI Dynamic (MPCM Layer Catalog), WMS/WFS (Geoserver), CSV and GeoJSON.

Functionally, the SMK supports:

  • zooming and panning the map
  • showing information about the current location
  • clicking on a map features to show its properties
  • adding and removing features in a selection set
  • searching for places and landmarks by name
  • finding the best route between points
  • marking the map with annotations
  • measuring distances and areas

I created a map then moved on to other things. How do I edit the map now?

If you created the site in C:\apps, then there should be a directory in that, for example: C:\apps\smk-fap

Open the Windows command prompt Start...cmd, navigate to C:\apps\smk-fap and then run smk edit; this will fire up the SMK Editor for you.

Note: The syntax prompt indicates smk edit [-p port]but you don’t have to specify a port if you use the defaults.

What does the SMK output?

The SMK writes a series of files to your project directory. Notably an “index.html” and an “smk-config.json” along with a host of other files on which they are dependent. The result is you can pick it up and port it to any web space and run your site. The “smk-config.json” is strictly configuration for your site. All the calls to Leaflet, etc. reside within the SMK itself. Your index.html needs to reference an instance of the SMK whether that is within your deployment or external to it. There could be reasons for either case. More info on this architectural matter to come...

“DataBC says it can provide hosting for a fee” – What are the costs? DataBC offers hosting on the OpenShift platform “for a fee” as the intentionally vague product flyer stated. OpenShift is a great environment for high traffic/high availability sites. This service is currently free to us but we expect the group managing it to implement cost recovery in the coming months. At that point it would cease to be free to us and also to our downstream clients. Unfortunately, no number is available because it is yet unknown. If you’re not concerned with high traffic and vanity URLs, you could consider hosting your SMK site on GitHub pages. More info on this architectural matter to come...

Can SMK generate a map consuming data stored outside of BCGW, such as on an FTP, GitHub or in ArcGIS Online?

In terms of data access in SMK, currently the options in the SMK Editor are:

  • DataBC Layers, i.e. you can live stream BCGW data via the MPCM layer catalog (same as iMapBC)
  • WMS Layers, i.e. you can live stream image overlay of BCGW data via Geoserver WMS
  • Vector Layers, i.e. you can import GeoJSON, KML, Shapefile, CSV files into your site or make feature requests (WFS/WMS) from any Geoserver instance; if you want to cluster or heatmap data this is the option you want to use

There is room for expansion; please submit requests and uses cases via the SMK GitHub Issues page

I want to use Geoserver layers on my map but the number of features returned seems limited. What's the deal?

If you're using Geoserver Web Feature Services (WFS) to access vector data you will encounter a feature limit. The BC Gov limit is currently 500 features. This may be why you find gaps in the data. If you need to cluster the data you can reference it via Web Map Services (WMS) and specify an format (output) type of &format=application/json;type=geojson. WMS does not have the same limit as WFS but you must ensure that your bbox is large enough to encompass all features.

Example WFS (limited to 500 features): http://openmaps.gov.bc.ca/geo/ows?service=WFS&version=2.0&request=GetFeature&typeName=pub:WHSE_IMAGERY_AND_BASE_MAPS.GSR_SCHOOLS_K_TO_12_SVW&outputFormat=application/json&srsname=EPSG:4326

Example WMS: https://openmaps.gov.bc.ca/geo/pub/WHSE_IMAGERY_AND_BASE_MAPS.GSR_SCHOOLS_K_TO_12_SVW/ows?service=WMS&request=GetMap&version=1.1.1&layers=pub%3AWHSE_IMAGERY_AND_BASE_MAPS.GSR_SCHOOLS_K_TO_12_SVW&styles=3601&format=application/json;type=geojson&transparent=true&cql_filter=include&srs=EPSG%3A4326&width=645&height=728&bbox=-144.19403793672322,45.39637993438814,-108.99384262912152,62.632414448856416

Clone this wiki locally