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

tablacusmapsapi

v0.1.6

Published

Tablacus Yet another Maps API with leaflet (OpenStreetMap)

Downloads

129

Readme

Tablacus Maps API

Yet another Maps API with leaflet (OpenStreetMap)

Usage

Latest version

<script async defer src="https://unpkg.com/tablacusmapsapi/tablacusmapsapi.js?alias=google&...." ></script>

Specify version 0.1.6

<script async defer src="https://unpkg.com/[email protected]/tablacusmapsapi.js?alias=google&...." ></script>

Some exsamples

Sample

<script>
var map;
var geocoder;

function initMap ()
{
    var latlng = new google.maps.LatLng(37.78, -122.41);
    map = new google.maps.Map(document.getElementById('map'), {
        zoom: 11,
        center: latlng
    });
    geocoder = new google.maps.Geocoder();
}

function setCenter(o)
{
    var latlng = new google.maps.LatLng(document.F.centerLat.value, document.F.centerLng.value);
    map.setCenter(latlng);
}

function marker(o)
{
    var latlng = new google.maps.LatLng(document.F.markerLat.value, document.F.markerLng.value);
    var marker = new google.maps.Marker({
        title: "Tooltip",
        position: latlng,
        map: map
    });
    var infoWin = new google.maps.InfoWindow({content:"marker Info window"});
    google.maps.event.addListener(marker, 'click', function(){
        infoWin.open(map, marker);
    });
}

function markerIcon(o)
{
    var latlng = new google.maps.LatLng(document.F.marker2Lat.value, document.F.marker2Lng.value);
    var marker = new google.maps.Marker({
        title: "Tooltip",
        position: latlng,
        icon: document.F.marker2Img.value,
        map: map
    });
    var infoWin = new google.maps.InfoWindow({content:"marker Info window"});
    google.maps.event.addListener(marker, 'click', function(){
        infoWin.open(map, marker);
    });
}

function clickEvent(o)
{
    o.disabled = true;
    google.maps.event.addListener(map, 'click', function (event)
    {
        document.getElementById("lat").innerHTML = event.latLng.lat();
        document.getElementById("lng").innerHTML = event.latLng.lng();
    });
}

function circle(o)
{
    var circle = new google.maps.Circle({
        center: new google.maps.LatLng(document.F.circleLat.value, document.F.circleLng.value),
        map: map,
        radius: document.F.circleRadius.value
      });
}

function rectangle(o)
{
    var rectangle = new google.maps.Rectangle({
        bounds: new google.maps.LatLngBounds(new google.maps.LatLng(document.F.rect1Lat.value, document.F.rect1Lng.value),
                     new google.maps.LatLng(document.F.rect2Lat.value, document.F.rect2Lng.value)),
        map: map,
      });
}

function polyline(o)
{
    var patharray = new Array();
    var ar = document.F.polylineLatLngs.value.split(/\n/);
    for (var i in ar) {
        var latlng = ar[i].split(/,/);
        if (latlng[0] && latlng[1]) {
            patharray.push(new google.maps.LatLng(latlng[0], latlng[1]));
        }
    }
    var polyline = new google.maps.Polyline({
        map: map,
        path: patharray
    });
}

function polygon(o)
{
    var patharray = new Array();
    var ar = document.F.polygonLatLngs.value.split(/\n/);
    for (var i in ar) {
        var latlng = ar[i].split(/,/);
        if (latlng[0] && latlng[1]) {
            patharray.push(new google.maps.LatLng(latlng[0], latlng[1]));
        }
    }
    var polygon = new google.maps.Polygon({
        map: map,
        paths: patharray
    });
}

function geocoding()
{
    geocoder.geocode( { 'address': document.F.geoQuery.value },
        function (results, status) {
            if (status == google.maps.GeocoderStatus.OK) {
                var latlng = results[0].geometry.location;
                map.setCenter(latlng);
                document.getElementById('geoLat').innerHTML = latlng.lat();
                document.getElementById('geoLng').innerHTML = latlng.lng();

                var marker = new google.maps.Marker({
                    title: document.F.geoQuery.value,
                    position: latlng,
                    map: map
                });
            }
        }
    );
}

function toggle(s)
{
    var o = document.getElementById(s);
    o.style.display = /none/i.test(o.style.display) ? "block" : "none"; 
}
</script>
<script async src="https://unpkg.com/tablacusmapsapi/tablacusmapsapi.js?callback=initMap&alias=google"></script>

<div id="map" style="width: calc(100% - 20em); height: 100%; float: left"></div>
<form name="F">
    <input type="button" value="+" onclick="toggle('_setCenter')">
    <div id="_setCenter" style="display: none">
        lat:<input type="number" name="centerLat" value="37.78"><br>
        lng:<input type="number" name="centerLng" value="-122.41">
    </div>
    <input type="button" value="setCenter" onclick="setCenter(this)">
    <hr>
    <input type="button" value="+" onclick="toggle('_clickEvent')">
    <input type="button" value="Click event" onclick="clickEvent(this)">
    <div id="_clickEvent" style="display: none">
        lat: <span id="lat"></span><br>
        lng: <span id="lng"></span><br>
    </div>
    <hr>
    <input type="button" value="+" onclick="toggle('_marker')">
    <div id="_marker" style="display: none">
        lat: <input type="number" name="markerLat" value="37.78"><br>
        lng: <input type="number" name="markerLng" value="-122.41">
    </div>
    <input type="button" value="Marker" onclick="marker(this)"><br>
    <hr>
    <input type="button" value="+" onclick="toggle('_marker2')">
    <div id="_marker2" style="display: none">
        lat: <input type="number" name="marker2Lat" value="37.82"><br>
        lng: <input type="number" name="marker2Lng" value="-122.37"><br>
        img: <input type="text" name="marker2Img" value="./xf.png">
    </div>
    <input type="button" value="Marker icon" onclick="markerIcon(this)"><br>
    <hr>
    <input type="button" value="+" onclick="toggle('_circle')">
    <div id="_circle" style="display: none">
        lat:<input type="number" name="circleLat" value="37.86"><br>
        lng:<input type="number" name="circleLng" value="-122.43"><br>
        radius:<input type="number" name="circleRadius" value="2500">
    </div>
    <input type="button" value="Circle" onclick="circle(this)"><br>
    <hr>
    <input type="button" value="+" onclick="toggle('_rectangle')">
    <div id="_rectangle" style="display: none">
        lat:<input type="number" name="rect1Lat" value="37.77"><br>
        lng:<input type="number" name="rect1Lng" value="-122.45"><br>
        lat:<input type="number" name="rect2Lat" value="37.74"><br>
        lng:<input type="number" name="rect2Lng" value="-122.51"><br>
    </div>
    <input type="button" value="Rectangle" onclick="rectangle(this)"><br>
    <hr>
    <input type="button" value="+" onclick="toggle('_polyline')">
    <div id="_polyline" style="display: none">
        <textarea name="polylineLatLngs" style="height: 5em">37.78,-122.44
37.78,-122.47
37.86,-122.49
        </textarea>
    </div>
    <input type="button" value="Polyline" onclick="polyline(this)"><br>
    <hr>
    <input type="button" value="+" onclick="toggle('_polygon')">
    <div id="_polygon" style="display: none">
        <textarea name="polygonLatLngs" style="height: 5em">37.77,-122.42
37.80,-122.27
37.72,-122.21
        </textarea>
    </div>
    <input type="button" value="Polygon" onclick="polygon(this)"><br>
    <hr>
    <input type="button" value="+" onclick="toggle('_geocoding')">
    <div id="_geocoding" style="display: none">
        lat:<span id="geoLat"></span><br>
        lng:<span id="geoLng"></span><br>
        <input type="text" name="geoQuery" value="berkeley">
    </div>
    <input type="button" value="Geocoding" onclick="geocoding(this)"><br>
    <hr>
</form>