Giter VIP home page Giter VIP logo

leaflet.locationlist's Introduction

leaflet.locationlist

A control for LeafletJS which scrolls the map through the list of locations and zooms.

##Example usage

  	var llist = L.control.locationlist();
  	map.addControl(llist);

Parameters

  var llist = L.control.locationlist({ locationsList : [ {title: 'Poland', latlng: [52.03, 19.27], zoom: 6},
					  {title: 'Other', latlng: [50.04, 14.28], zoom: 6},
					  {title: 'Other2', latlng: [50.04, 19.27], zoom: 12}],		
	nextText : '->',
	nextTitle : 'Next',
	prevText : '<-',
	prevTitle : 'Previous',
	showList : false });

locationsList

The array of objects containing locations in format { title: "", latlng: [,], zoom: } .The control will rotate over these locations on click. It assumes that the first location is by default selected, so Next location will be 1st and Prev location will be last in array. Than it scrolls in array, changing current location.

nextText, nextTitle, prevText, prevTitle

Helpers for arrows - what will be displayed on arrows as popup and if no image specified for them. Surely you'll never need these, but who know?

showList

Show a select box for quick jumps to the locations.

Images

Images for arrows are in img folder. They are specified in css, so you can change them into what you want.

Events

Events are added to interact with control from code. Events are fired on switching to next (the 'next' event) or to previous (the 'prev' event) location. Also a 'changed' event fires every time the map jumps. Example shows how to do it.

leaflet.locationlist's People

Contributors

mithron avatar

Watchers

 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.