Git Product home page Git Product logo

mapicgc-gl-js's Introduction

MapICGC Logo

License Version X

MapICGC GL JS

๐ŸŒ  Based on MapLibre GL JS version: 4.5.0

The MapICGC GL JS library builds upon the open-source library MapLibre GL JS, exposing its existing capabilities while introducing new features specific to the MapICGC ecosystem. This library is tailored to seamlessly integrate with the MapICGC Cloud service, offering a comprehensive set of data to enhance web mapping experiences, including vector tiles, satellite raster tiles, DEM with Terrain RGB, and customizable styles with an editor.

Our goal is to simplify the development process for MapICGC developers! With MapICGC GL JS, you won't need to load external plugins for basic functionalities, deal with complex data source URLs, or search for syntax to enable 3D terrain every time you embark on a project. All these features are either built-in, loaded dynamically when necessary, or accessible through straightforward functions.

Moreover, MapICGC GL JS provides well-documented and user-friendly wrapper functions for MapICGC Cloud API services, including geocoding, static maps, geolocation, and a coordinate reference system search engine for transforming coordinates between different CRSs.


Documentation

Full documentation for this library is available here.

Check out the features through examples.


Getting Started

NPM

  1. Install the library:
    npm i mapicgc-gl-js
    
  2. Import the library:
    <script>
     import { Map, Config } from "mapicgc-gl-js";
    //import * as mapicgcgl from  "mapicgc-gl-js";
    
    
      async function initMap() {
          const data = await Config.getConfigICGC(); //load config
          const map = new Map({
            container: "map",
            style: data.Styles.LIGHT,
            center: [1.808, 41.618],
            zoom: 10,
            maxZoom: 19,
            hash: true,
            pitch: 0,
          });
      }
      initMap();
    </script>

CDN

  1. Include the JavaScript and CSS files in the <head> of your HTML file.:

    <script src="https://tilemaps.icgc.cat/cdn/mapicgc-gl-js/mapicgc-gl.js"></script>
    <link href="https://tilemaps.icgc.cat/cdn/mapicgc-gl-js/mapicgc-gl.css" rel="stylesheet" />
  2. Include the following code in the <body> of your HTML file.:

     <div id="map"></div>
     <script>
       async function initMap() {
         const data = await  mapicgcgl.Config.getConfigICGC();
         const map = new mapicgcgl.Map({
           container: "map",
           style: data.Styles.TOPO, // <-- add style basemap here
           center: [2.1464, 41.306],
           zoom: 7.4,
           maxZoom: 19,
           hash: true,
           pitch: 0,
         });
     </script>

Result:


Dependencies

MapICGC GL JS integrates the following libraries:


Developed by:

ICGC Logo

License

MAPICGC GL JS is licensed under the 3-Clause BSD license.

mapicgc-gl-js's People

Contributors

lstiz avatar sfggeogis avatar unitatgeostart avatar

Stargazers

Marc Roca  avatar Bernat  avatar  avatar  avatar

Watchers

GeoStart avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.