Skip to content

liubgithub/maptalks.customzoom

Repository files navigation

maptalks.customzoom.js

CircleCI NPM Version

A plugin of maptalks.js to set a custom zoom control which is different from maptalks's zoom control,and update some functions.

Examples

Install

  • Install with npm: npm install maptalks.customzoom.
  • Download from dist directory.
  • Use unpkg CDN: https://unpkg.com/maptalks.customzoom/dist/maptalks.customzoom.min.js

Usage

As a plugin, maptalks.customzoom must be loaded after maptalks.js in browsers.

<script type="text/javascript" src="https://unpkg.com/maptalks/dist/maptalks.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/maptalks.customzoom/dist/maptalks.customzoom.min.js"></script>
<script>
var zoom = new maptalks.CustomZoom({position: {
                    left: 100,
                    top: 50
                }
            }).addTo(map);
</script>

Supported Browsers

IE 9-11, Chrome, Firefox, other modern and mobile browsers.

API Reference

CustomZoom is a subclass of maptalks.control.Control and inherits all the methods of its parent.

Constructor

new maptalks.CustomZoom(options)
  • options Object some config for the zoom control

you can reference to demo in the 'demo' file

Contributing

We welcome any kind of contributions including issue reportings, pull requests, documentation corrections, feature requests and any other helps.

Develop

The only source file is index.js.

It is written in ES6, transpiled by babel and tested with mocha and expect.js.

Scripts

  • Install dependencies
$ npm install
  • Watch source changes and generate runnable bundle repeatedly
$ gulp watch
  • Tests
$ npm test
  • Watch source changes and run tests repeatedly
$ gulp tdd
  • Package and generate minified bundles to dist directory
$ gulp minify
  • Lint
$ npm run lint

About

custom zoom control based on maptalks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors