Code Monkey home page Code Monkey logo

leaflet.boatmarker's Introduction

⛵️ Leaflet.BoatMarker npm version

A leaflet boat marker using HTML Canvas. Checkout the Demo.

Can be used to symbolize sailboats/sailyachts or motorboats/motoryachts with optional wind information.

Installation

  • Include the script directly
<script src="https://unpkg.com/leaflet.boatmarker/leaflet.boatmarker.min.js"></script>
  • Use in a build script via npm
npm i leaflet.boatmarker --save

Usage

var boatMarker = L.boatMarker(map.getCenter(), {
  	color: "#f1c40f", 	// color of the boat
	idleCircle: false	// if set to true, the icon will draw a circle if
						// boatspeed == 0 and the ship-shape if speed > 0
});
setHeading(heading)

Sets the current heading of the boat to an angle value between 0 and 360 degrees.

boatMarker.setHeading(60);
setHeadingWind(heading, windspeed, winddirection)

Sets the current heading of the boat to an angle value between 0 and 360 degrees, the current wind direction to an angle value between 0 and 360 degress and the wind speed (in knots) following this weather wind arrow specification http://www.wetterklima.de/segeln/windpfeile/bf.htm

boatMarker.setHeadingWind(60, 4.5, 20);
setSpeed(speed)

Set the current speed of the boat to a value > 0

boatMarker.setSpeed(12.9);

leaflet.boatmarker's People

Contributors

thomasbrueggemann 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.