@hpcc-js/map

This package is part of the mono repository "@hpcc-js" (aka Visualization Framework), for more information including Quick Start, Gallery and Tutorials, please visit the main page on GitHub: hpcc-systems/Visualization.

Exported Widgets

Stand-alone HTML Example

<html>
    <head>
        <title>Simple GMap with pins and lines</title>
        <script src="https://unpkg.com/@hpcc-js/util"></script>
        <script src="https://unpkg.com/@hpcc-js/common"></script>
        <script src="https://unpkg.com/@hpcc-js/api"></script>
        <script src="https://unpkg.com/@hpcc-js/layout"></script>
        <script src="https://unpkg.com/@hpcc-js/map"></script>
    </head>
    <body>
        <div id="placeholder" style="width:400px;height:400px;"></div>
        <script>
            var widget = new window["@hpcc-js/map"].GMapPinLine()
                .target("placeholder")
                .columns(["name","lat1", "long1", "lat2", "long2"])
                .data([
                    ["Destination A",40.777,-73.872,33.64,-84.426],
                    ["Destination B",40.777,-73.872,39.997,-82.891],
                    ["Destination C",40.777,-73.872,32.895,-97.037],
                    ["Destination D",40.777,-73.872,26.072,-80.152],
                    ["Destination E",40.777,-73.872,34.895,-82.218]
                ])
                .fromLatitudeColumn("lat1")
                .fromlongitudeColumn("long1")
                .toLatitudeColumn("lat2")
                .tolongitudeColumn("long2")
                .autoScale(true)
                .render(w => {
                    setTimeout(function () {
                        w.render();
                    }, 500);
                })
                ;
            widget.click = function(pinData){
                console.log("Clicked pin data:",pinData);
            }
        </script>
    </body>
</html>