Skip to content

daniel-kullmann/simple-offline-map

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

Simple offline maps application

This is a small maps application with support for an offline cache for the map tiles.

Features

  • Shows a map via the Leaflet library, using tiles from OpenStreetMap
  • Show GPX tracks
  • Create new tracks
  • Can optionally use a local tile cache so that offline usage is possible

Planned features (TODO list):

  • Use React or another framework to better structure the code
  • Management of GPX files
    • Don't show all gpx files; allow selection of gpx files, and then switching them on and off
    • Automatic and manual tagging of GPX files
  • Adding your own tracks
    • TODO Determine and save metadata (date, description, ...)
  • Enhance showing of GPX:
    • Customizing markers and colors of shown GPX tracks
  • Add customizing of tiles cache (maximum age of tiles, maximum size of cache)
  • Add refreshing of cache
    • For that, we need to store cache metadata, like the etags and max-age headers that come from the OSM tile server.
  • Use a real DB (PostgreSQL) instead of SQLite
  • Add authentication and authorization
  • Deployment on some cloud environment
    • e.g. Google Cloud or Digital Ocean or a German provider
    • easy deploy and shutdown scripts
    • deploy script starts up the vm, installs dependencies, starts docker, builds the app images and starts the container(s), and restores the latest backup of the DB and the GPX files
    • shutdown script creates a backup of the DB and the GPX files, shuts down the vm

Configuration

TODO

Installation

Setup (you only have to do this once):

  • Install golang
  • Make sure that the GOBIN environment variable is set to a directory that is available on PATH, e.g. export GOBIN=$HOME/bin
  • Install go-bindata: run go get -u github.com/jteeuwen/go-bindata/...
  • Make sure that the go-bindata command is available by running it

To build the executable, you need to execute these commands:

cd go-maps-backend
go generate
go build -o simple-offline-map

Instead of go generate, you can also run go-bindata -prefix ../frontend/ ../frontend/....

You can also just do a make to build the binary.

The resulting binary is located in ./go-maps-backend/simple-offline-map.

Build a docker image

I also added the necessary files to build a docker image. Since this docker image is based on Alpine, and Alpine uses a different loader .so than regular linux systems, I use a separate docker image just to build the binary. This results in a really small resulting docker image (~19MB), while the docker image for building is ~600MB.

Simply call make docker-image for creating the docker-image, or look into the Makefile under the docker-image heading to see how the image is built.

About

Simple map web application with both django and golang backends.

Resources

Stars

Watchers

Forks