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

vectormap-js-dev

v2.0.0-beta008

Published

openlayers mapsuite

Downloads

41

Readme

Alt ThinkGeo

MapSuite

The mapsuite-vectormap.js is an open-source JavaScript SDK and an extension of OpenLayers to create maps for web and mobile devices. With the help of Map Suite vector styling schema - StyleJSON, you can easily create beautiful maps for your application.

With Map Suite VectorMap.js, you will have full access to OpenLayers, as well as any plugins or extensions created based on OpenLayers, for example, the "3rd party libraries" published on https://openlayers.org. With the help of them, you can easily create any styled map and put it anywhere, and build a customized geocoding or routings from other providers.

Wiki Documentation: http://wiki.thinkgeo.com/wiki/map_suite_api

Light Map Style

Alt ThinkGeo

Dark Map Style

Alt ThinkGeo

Hybrid Map Style

Alt ThinkGeo

Install

The official guide assumes intermediate level knowledge of HTML, CSS, and JavaScript, and have some experience of any front-end development editor, such as Visual Studio Code, Webstorm, Sublime Text or some similars. if you are totally new to frontend development, the easiest way to try out this library is using the "OpenCodePen Hello World exampleLayers". Feel free to open it in another tab and follow along as we go through some features.

2 options of installing Map Suite VectorMap.js:

  • Use NPM install
npm install vectormap-js

or 

npm install vectormap-js-dev
  • Include related in
<!-- style sheet for vectormap.js -->
<link rel="stylesheet" href="https://cdn.thinkgeo.com/vectormap/0.1.0/mapsuite-vectormap.css"></link>

<!-- latest minified version of vectormap.js -->
<script src="https://cdn.thinkgeo.com/vectormap/0.1.0/mapsuite-vectormap.js"></script>

Get Started

Set up a basic map with VectorMap.js in 6 steps (here take Visual Studio Code for example).

Step 1. Create a html page with name "index.html "

Step 2. In the <head>of your HTML page, import the vectormap.js and related css file.

<!-- style sheet for vectormap.js -->
<link rel="stylesheet" href="https://cdn.thinkgeo.com/vectormap/0.1.0/mapsuite-vectormap.css"></link>

<!-- latest minified version of vectormap.js -->
<script src="https://cdn.thinkgeo.com/vectormap/0.1.0/mapsuite-vectormap.js"></script>

And add a height and width for the map:

 <style>
    #map {
        width: 800px;
        height: 600px;
    }
 </style>

Step 3. In the <body> of your HTML page, add a "map" div.

<div id="map"></div>

Step 4. At the bottom of the html page, add a JavaScript section to create an instance of map control, and add the vector layer.

<script>
    var worldStreetsLayer = new ol.mapsuite.VectorTileLayer("thinkgeo-world-streets-light.json", 
        {
            'apikey':'your-thinkgeo-gis-service-vector-tile-key'
        });
    let map = new ol.Map({
        layers: [worldStreetsLayer],
        target: 'map',
        view: new ol.View({
            center: ol.proj.fromLonLat([-96.79620, 32.79423]),
            zoom: 2,
        }),
    });
</script>

NOTE: Please check here on how to create your own ThinkGeo GIS Service Vector Tile key.

Step 5. Download one of Predefined open source styles and copy it to the directory where the index.html is. For example, we can call it "thinkgeo-world-streets-light.json".

After all the above steps completed, your HTML page should be:

<!DOCTYPE html>
<html>
    <head>
        <title>Sample Map</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="https://cdn.thinkgeo.com/vectormap/0.1.0/mapsuite-vectormap.css" type="text/css">
        <script src="https://cdn.thinkgeo.com/vectormap/0.1.0/mapsuite-vectormap.js"></script>
         <style>
            #map {
                width: 800px;
                height: 600px;
            }
         </style>
    </head>
    <body>
        <div id="map"></div>
        <script>
            var worldStreetsLayer = new ol.mapsuite.VectorTileLayer("thinkgeo-world-streets-light.json", 
            {
                'apikey':'your-thinkgeo-gis-service-vector-tile-key'
            });
            let map = new ol.Map({
                layers: [worldStreetsLayer],
                target: 'map',
                view: new ol.View({
                    center: ol.proj.fromLonLat([-96.79620, 32.79423]),
                    zoom: 2,
                }),
            });
        </script>
    </body>
</html>

Step 6. Run the page and a beautiful map there.

NOTE:

ThinkGeo Icon FontSet is an icon set, which is used in "Predefined open source styles" as POI icons. If you are using ready-to-go predefined styleJSON file downloaded, please add following code in "<Head>".

<script src="https://cdn.thinkgeo.com/icons-font/0.1.0/webfontloader.js"></script>
<script>
    WebFont.load({
        custom: {
            families: ["ThinkgeoFont"],
            urls: ["https://cdn.thinkgeo.com/icons-font/0.1.0/thinkgeo-font.css"]
        }
    });
</script>

Vector Tiles

Besides loading the traditional KML, GeoJSON, bitmap tiles etc., Map Suite vectormap.js draws its own tiles from vector tiles that contains the source data.

Map Suite GIS Service provides a free vector tile service (*.mvt) based on open data from OpenStreetMap, Natural Earth and some other data providers, with global coverage updated continuously. - sign up for an API Key here.

Styling

Map Suite vector styling schema - Vector StyleJSON is designed for you to specify data sources, layers and how to define and apply styles to layers. Please check the demo from "Predefined open source styles" or check related documentation at https://thinkgeo.gitbooks.io/map-suite-stylejson-specification/content/.

Browser Suport

mapsuite-vectormap.js is officially supported and tested on the last two versions of these browsers:

  • Mac OS: Chrome, Firefox, and Safari
  • Windows: Chrome, Firefox, IE11, and IE Edge
  • iOS: Safari, Chrome, Firefox
  • Android: Chrome

mapsuite-vectormap.js should also run in any brower with HTML5 support.

License

mapsuite-vectormap.js is licensed under the Apache 2.0.