npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

maplarge-google

v3.1.0

Published

Google layer for working with maplarge layers

Downloads

10

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.
  • dissolve: if you have a point table and want to buffer it based ona certain collumn (in miles) and then disolve the result, pass the field here.

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.

Events

  • fullTable: Emitted when a table version is found and anytime it updates
  • zoom-started: emitted when a user starts zooming
  • zoom-ended: emitted when a user finishes zooming

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"
          }
        ]
      ]
    }
    ]
  }
]

Upgrading to Version 3

The main breaking change for version 3 was a switch to native ES modules. We also no longer cache the google global so if you had to do any weird delated importing of this module you should be able to import it as a standard ES module at the top of your file.

We also are no longer building compiled versions of this library in the dist folder. If you were relying on those open an issue.