Coder Social home page Coder Social logo

huweilu / maptalks.minedata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sakitam-gis/maptalks.minedata

0.0 1.0 0.0 355 KB

maptalks plugin to minedata

Home Page: https://sakitam-gis.github.io/maptalks.minedata/demo/index.html

License: Other

JavaScript 100.00%

maptalks.minedata's Introduction

maptalks.minedata

A plugin to add minedata as a layer for maptalks.js.

Examples

Install

  • Install with npm: npm install @sakitam-gis/maptalks.minedata.
  • Use unpkg CDN: https://unpkg.com/@sakitam-gis/maptalks.minedata/dist/maptalks.minedata.min.js

Usage

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

<div id="map"></div>
<script src="../lib/minemap.js"></script>
<script src="../node_modules/maptalks/dist/maptalks.js"></script>
<script src="../dist/maptalks.minedata.js"></script>
<script type="text/javascript">
    minemap.accessToken = '25cc55a69ea7422182d00d6b7c0ffa93';
    minemap.solution = 2365;
    var baseLayer = new maptalks.MineLayer('tile',{
        glOptions : {
            'style' : '//minedata.cn/service/solu/style/id/2365'
        }
    }).on('layerload', function () {
        // start();
    });

    var map = new maptalks.Map('map', {
        center: [116.46,39.92],
        zoom: 16,
        baseLayer: baseLayer
    });
</script>

Supported Browsers

IE 11, Chrome, Firefox, other modern and mobile browsers support WebGL.

API Reference

MineLayer is a subclass of maptalks.Layer and inherits all the methods of its parent.

Constructor

new maptalks.MineLayer(id, options)
  • id String layer id
  • options Object options

getGlMap()

get minedata map instance used by the layer

Returns Map

toJSON()

export the layer's JSON.

var json = MineLayer.toJSON();

Returns Object

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

maptalks.minedata's People

Contributors

sakitam-fdd avatar

Watchers

James Cloos 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.