# canvas-map

> Canvas Map with Iso / Cartesian Mode. It uses virtual Canvas in background that provide individual slices that are stacked once they need to be shown on physical canvas - this improves zooming and moving since these actions will just copy & paste images f

Latest version **0.2.2** (published 2019-06-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install canvas-map
pnpm add canvas-map
yarn add canvas-map
bun add canvas-map
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2019-06-17 |
| First published | 2019-06-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Renner |
| Maintainers | reda1000 |
| Keywords | Canvas, Map, Isometric, Cartesian |

## Links

- npm: https://www.npmjs.com/package/canvas-map
- Repository: https://github.com/Reda1000/canvas-map
- Homepage: https://github.com/Reda1000/canvas-map#readme
- Issues: https://github.com/Reda1000/canvas-map/issues
- npm.io page: https://npm.io/package/canvas-map

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.2.2 (latest) — 2019-06-17
- 0.2.1 — 2019-06-12
- 0.2.0 — 2019-06-12

## README

# canvas-map
HTML5 Canvas map for showing isometric and cartesian maps. 

__Currently under development / testing / documentation. and therefore not fully available yet.__

## Depends
HTML5 Canvas

## Demo
https://reda1000.github.io/canvas-map/demo.html

## Usage
1. Download the assets and put them under your HTTP-Server reachable as [origin]/assets - thats where the tile images are currently being fetched from.
2. Render a map in your Browser in simple JS:


        <script src="http://cdn.jsdelivr.net/gh/Reda1000/canvas-map/canvasmap.bundle.min.js"></script>
        <script src="http://cdn.jsdelivr.net/gh/Reda1000/canvas-map/example.map.js"></script>
        <script>
            config = undefined; // use internal standard config
            map = defaultMap
            mapInstance = new canvasmap.IsoMap({
                window: { nativeElement: window },
                parent: { nativeElement: document.getElementById('parent') },
                cnvs: { nativeElement: document.getElementById('canvas') }
            }, config, map);
            mapInstance.setSelectedCB((a) => console.log(a));
        </script>

Hint: In case you are interested in an Angular2+ Typescript Port please have a look at ngx-canvas-map in NPM - planning on porting to ReactJS as well.

## Documentation
<!-- 
@startuml

interface CoordResolverInterface
abstract class CoordResolver
class CartCoordResolver
class IsoCoordResolver

CoordResolverInterface <|-- CoordResolver
CoordResolver <|-- CartCoordResolver
CoordResolver <|-- IsoCoordResolver

interface CanvasConfig
class Config

CanvasConfig <|-- Config : default of <

interface CanvasSettings

interface CanvasLayer

class CanvasRenderer
class Controller
Controller -left- CanvasRenderer : controls >
CanvasRenderer -left- CoordResolver : renders via >
Controller .. CanvasSettings : Memory
Controller .. CanvasLayer : LayerSetup
Controller .. CanvasConfig : Configuration

interface MapConfig
interface Map<T>
interface Tile<T>
MapConfig <|-right- Map
Map -right- Tile : contains n >
Map -- Controller

enum ORRIENTATION {
WEST,
NORTH,
EAST,
SOUTH
}

@enduml
-->
![alt text](https://github.com/Reda1000/canvas-map/blob/master/diagram.png)

## Installing
npm install canvas-map

## Tests
Not yet available

## Contribution
Very thankful for the assets that are being used in the examples from https://github.com/BulloRosso/isoplant

## License
MIT, see LICENSE.txt

---
_Source: https://npm.io/package/canvas-map · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
