Giter Site home page Giter Site logo

leaflet.gars's Introduction

Leaflet.GARS

Display a GARS(Global Area Reference System) overlay on a Leaflet 0.7.7 map.

Usage

      map = new L.Map('map');

      // create the tile layer with correct attribution
      var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
      var osmAttrib='Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors';
      var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 20, attribution: osmAttrib});

      map.setView(new L.LatLng(47.11922345184392, -88.54714393615723),11);
      map.addLayer(osm);

      var gars = L.gars().addTo(map);

      L.control.layers({
          'osm': osm
        }, {
          'GARS': gars
        }).addTo(map);

You can pass an optional options argument to L.gars, and it will overide any of the options shown at the top of L.GARS.js.

  var options = {
    bigStyle: {
      fill: true,
      fillOpacity: 0.42,
      fillColor: "#ccc",
      labelPos: {
        x: 0.25,
        y: 0.25,
      },
    },
    //and whatever else you want to change
  };
  var gars = L.gars(options).addTo(map);

Additionally, there are three css classes for styling the label text, bigLabel, quadLabel, and tinyLabel

leaflet.gars's People

Contributors

mtfurlan avatar

Watchers

James Cloos avatar  avatar Eric Barch 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.