maplarge-google

WIP maplarge tile layer for use with google maps.

Showing:

Popularity

Downloads/wk

4

GitHub Stars

3

Maintenance

Last Commit

2yrs ago

Contributors

2

Package

Dependencies

7

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

maplarge-google

Google layer for working with maplarge layers. Currently very rough, use at own risk.

npm version

npm install --save maplarge-google

API

The constructor takes several options, many of them mandatory

  • account
  • table
  • host
  • type: line or point (only needed if type can't be inferred from table name, i.e. ending with Line or Point like conditionLine).
  • subdomains: number of different subdomains, since the domains are zero indexed this is one more then the max subdomain.
  • minzoom: default 0.
  • maxzoom: default 20.
  • click: handler for click events, mandatory if you want interaction.
  • fields: array of fields to return to the click function.
  • refresh: how often to check if the data has been updated (and if so refresh the tiles), if absent then data is not refreshed.
  • sort: if a field should be used for sorting the features.
  • zindex: maintaining layer ordering when you have multiple maplarge layers.

Methods

  • .setMap pass it a map object to add it to a map or null to remove it
  • .updateQuery pass in a maplarge query object to apply that filter to the layer
  • .getInfo give it a lat, lng, and a zoom and it will give you the info of all the features that were clicked on, taking into account zoom and what not, returns a promise.
  • .query give it a maplarge query object and it returns a promise for the result.

Example Rules

  • a simple rule set visible at all zoom levels
{
  "rules": [
    {
      "style": {
        "antiAliasing": "true",
        "blending": "true",
        "endCap": "Round",
        "fillColor": "255-0-191-0",
        "lineOffset": "5",
        "startCap": "Round",
        "width": "4"
      },
      "where": "CatchAll"
    }
  ]
}
  • a ruleset that changes at zoom 10
[
  {
    "range": [0, 10],
    "rules":  [
    {
      "style": {
        "antiAliasing": "true",
        "blending": "true",
        "endCap": "Round",
        "fillColor": "255-0-191-0",
        "lineOffset": "5",
        "startCap": "Round",
        "width": "4"
      },
      "where": "CatchAll"
    }
    ]
  },
  {
    "range": [10, 15],
    "rules":  [
    {
      "style": {
        "antiAliasing": "true",
        "blending": "true",
        "endCap": "Round",
        "fillColor": "255-0-191-0",
        "lineOffset": "5",
        "startCap": "Round",
        "width": "4"
      },
      "where": [
        [
          {
            "col": "RAMP",
            "test": "Contains",
            "value": "EXIT"
          }
        ]
      ]
    }
    ]
  }
]

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial