Giter Club home page Giter Club logo

osm-raster-map's Introduction

OSM Raster Tile Map

DEMO

This project demonstrates the use of raster tiles from a publicly reachable, unauthenticated Mapy.cz tile server.

I've built it for fun and as a detour from trying to figure out a frustrating problem with vector tiles from a different source.

I generally believe raster tiles are inferior to vector tiles, but boy, are they easier to work with!

To-Do

Make double click to zoom in and out zoom so that the point stays under the cursor not in the center

Seed location and zoom from storage but replace with live values when available

Implement fractional zoom

Export tracks as SVG for saving to Files on iOS

Update locator POI in track mode

Use canvas clipping to confine repainted POIs and strokes within the currently updated tile

https://www.w3schools.com/tags/canvas_clip.asp

Hook up touch events for zoom in / out on double tap

Add support for rotating the map (by UI buttons as well as heading from geo loc) - use canvas transforms

Link server and tile size together so the HD one (512) and the others (256) work correctly

without specifying size in drawImage

Persist pins & strokes in the local storage

Put back drawing strokes on the map (canvas clip to tile being rerendered)

use https://stackoverflow.com/a/365853/2715716 to display the stroke length in km/m

Persist map configuration (longitude, latitude, zoom) after each change to restore where left off

Possibly combine this with refactoring the map code to a class Map with events like onTileLoad, onTileRender etc.

Implement pinch to zoom

Refactor the map logic to a Map class with events for tile load (checker board) and tile render and provide multiple renderers:

The current canvas based one (tiles and POIs rendered on canvas) and an image based one (tiles and POIs CSS placed). Consider making it so that the renderer may opt into loading the tiles itself so the img based on could use checker board background image and let the img elements load the tiles.

Benchmark the performance of the canvas and img based solutions somehow

DevTools FPS profile with programmatic pan/zoom sequence with clear cache?

Use OffscreenCanvas in the tile cache if supported (right now only Chrome)

Consider redrawing the whole canvas on each new tile load so that strokes and pins could be drawn once without getting clipped

As per https://wiki.openstreetmap.org/wiki/WikiProject_Czech_Republic

osm-raster-map's People

Contributors

tomashubelbauer avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.