Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL

Overview

Mapbox logo

Mapbox GL JS is a JavaScript library for interactive, customizable vector maps on the web. It takes map styles that conform to the Mapbox Style Specification, applies them to vector tiles that conform to the Mapbox Vector Tile Specification, and renders them using WebGL.

Mapbox GL JS is part of the cross-platform Mapbox GL ecosystem, which also includes compatible native SDKs for applications on Android, iOS, macOS, Qt, and React Native. Mapbox provides building blocks to add location features like maps, search, and navigation into any experience you create. To get started with GL JS or any of our other building blocks, sign up for a Mapbox account.

In addition to GL JS, this repository contains code, issues, and test fixtures that are common to both GL JS and the native SDKs. For code and issues specific to the native SDKs, see the mapbox/mapbox-gl-native repository.

Mapbox GL JS gallery of map images

Caption: (Mapbox GL JS maps, left-to-right, top-to-bottom): Custom styled point clusters, custom style with points, hexbin visualization on a Dark style map with Popups, data-driven circles over a raster layer with satellite imagery, 3D terrain with custom Markers, Mapbox Movement data visualization.

License

Copyright Β© 2021 Mapbox

All rights reserved.

Mapbox GL JS version 2.0 or higher (β€œMapbox Web SDK”) must be used according to the Mapbox Terms of Service. This license allows developers with a current active Mapbox account to use and modify the Mapbox Web SDK. Developers may modify the Mapbox Web SDK code so long as the modifications do not change or interfere with marked portions of the code related to billing, accounting, and anonymized data collection. The Mapbox Web SDK sends only anonymized usage data, which Mapbox uses for fixing bugs and errors, accounting, and generating aggregated anonymized statistics. This license terminates automatically if a user no longer has an active Mapbox account.

For the full license terms, please see the Mapbox Terms of Service.

Comments
  • Support non-mercator projections

    Support non-mercator projections

    Adding this back as an issue, since its original one was converted into stagnated PR #1466, but remains a pretty cool feature!

    Original Issue Text:

    Hey mapbox team! I first want to say I'm truly blown away by what you've built here. This is really, really impressive.

    Anyhow, I'm curious to know if there is any interest in support non-mercator projections? I checked out the transformation logic and the projection appears to be hard-coded.

    I'm sure there are optimizations to be had by assuming a single projection, but it would be really neat to be able to provide mapbox-gl with custom projection functions: not only would this enable other "common" map formats, but would open the door for some really creative visualizations (check out this and this).

    It would also make mapbox-gl an ideal candidate for non-geo-based maps, like a cross-section of a human body with organs, circulatory system, nervous system, etc.

    Thanks again for all the cool tech, and for developing in the open!

    Cheers, Mike

    feature :green_apple: 
    opened by mike-marcacci 89
  • Support clustering for HTML

    Support clustering for HTML "Marker"s

    Hello! As we can see here https://www.mapbox.com/mapbox-gl-js/example/custom-marker-icons/ we could create a custom Marker and add it to map. e.g. new mapboxgl.Marker(...).setLngLat(...).addTo(map);

    I'm trying to find the way how to add marker to the layer and organize into the Cluster. Smth like https://www.mapbox.com/mapbox-gl-js/example/cluster/ but with custom Markers:

    1. var map = new mapboxgl.Map...
    2. map.addSource(...);
    3. map.addLayer(...);
    4. and here map.getLayer(...).addMarker(Marker). or marker.addto(Layer/Source) or ... As a result we should see a Cluster with custom markers.
    feature :green_apple: 
    opened by D1M 87
  • Uncaught ReferenceError: _createClass is not defined (after transpiling with Babel)

    Uncaught ReferenceError: _createClass is not defined (after transpiling with Babel)

    --- πŸ”΄ EDIT from a gl-js maintainer πŸ”΄ ---- We've just opened #10565 do go over some of the decisions of why we moved to ES6, and also summarizing the solutions that everyone has contributed in this thread. Would love for the discussion to be continued there. πŸ™‡πŸ½ --- πŸ”΄ END EDITπŸ”΄-----

    mapbox-gl-js version: 2.0.0

    browser: Google Chrome Version 87.0.4280.67 (Official Build) (x86_64)

    Steps to Trigger Behaviour

    I'm trying to build a library of Vue components and one component uses mapbox-gl. I created a test project to showcase the issue.

    1. Create a Vue library (vue create library)
    2. Add mapbox-gl to the library in a component
    3. Build the library
    4. Use the library in a Vue application

    When I build and use it I have an error message saying:

    Uncaught ReferenceError: _createClass is not defined
    

    Link to Demonstration

    https://gitlab.com/antoinealej/test-lib-mapbox-gl-build

    Expected Behaviour

    Display the map over a beige background

    Actual Behaviour

    Only displays the beige background container

    bug :lady_beetle: 
    opened by antoinealej 82
  • tesselate polygons instead of rendering with stencil buffer

    tesselate polygons instead of rendering with stencil buffer

    We should draw polygons by tesselating them instead of using the stencil buffer trick. Native already does this. https://github.com/mapbox/mapbox-gl-js/commit/7b353122b46503b57e6d5073184883c1c2e21404 is a first attempt that uses libtess.js. Rendering is faster but the tesselation is slow. The buildings layer can take up to 500ms to tesselate.

    • take a look at poly2tri.js (which only accepts simple polygons)
    • revisit tesselating polygons in the tiles
    opened by ansis 80
  • Add support for markers

    Add support for markers

    I want to use this library in conjunction with the Mapbox service for a game I am currently developing. However, we need support for custom markers like the Google Maps JavaScript API provides. We need markers with custom images, bindable events and a similar simple API.

    mapbox.js β†’ GL JS 
    opened by tomaspinho 67
  • Stylesheet restructure

    Stylesheet restructure

    After working with the stylesheet structure a bit, I think there are a few improvements we can make without losing configuration flexibility.

    This is my personal wishlist, which draws from many of the previously discussed ideas in https://github.com/mapbox/llmr/issues/244, https://github.com/mapbox/llmr/issues/279, and https://github.com/mapbox/llmr/issues/276. I'm not sure if this should be the content for a preprocessor, a replacement for the current stylesheet, or a step towards a styling language.

    Here is an example to illustrate the idea:

    {
        buckets: {
            'streets': {
                'poi': {
                    layer: 'poi_label',
                    point: true,
                    children: {
                        'poi_park': {
                            filter: { 'maki': 'park' }
                            point: true,
                            text: {
                                textField: 'name',
                                path: 'curve',
                                font: 'Open Sans',
                                fontSize: 18
                            }
                        },
                        'poi_other': {
                            filter: { 'maki': ['airport', 'bus'] }
                            point: true,
                        }
                    }
                },
                'road': {
                    layer: 'road',
                    line: true,
                    'road_motorway': {
                        filter: { 'class': ['motorway', 'motorway_link'] },
                        line: {
                            cap: 'round',
                            join: 'bevel'
                        }
                    },
                    'road_main': {
                        filter: {
                            'class': 'main',
                            'oneway': 1
                        },
                        line: {
                            cap: 'round',
                            join: 'bevel'
                        }
                    }
                },
                'building': {
                    layer: 'building',
                    fill: true
                    stroke: {
                        cap: 'round',
                        join: 'round'
                    }
                },
                'wetland': {
                    layer: 'landuse_overlay',
                    filter: { 'class': 'wetland' },
                    fill: true
                }
            }
        },
        structure: [
            'wetland',
            'poi',
            'poi_park',
            'poi_other',
            { 
                composite: 'road',
                layers: [
                    'road_motorway',
                    'road_main'
                ] 
            },
            'building'
        ],
        layers: {
            'default': {
                'background': { fillColor: 'black' },
                'poi': {
                    fillColor: 'white',
                    pointRadius: 5
                },
                'poi_park': {
                    pointImage: 'park-18',
                    textColor: 'white',
                    textTranslate: [40, 0]
                },
                'poi_other': {
                    pointImage: 'star-stroked-18'
                },
                'road': {
                    opacity: 0.9
                },
                'road_motorway': {
                    fillColor: 'white',
                    lineWidth: 3,
                    strokeColor: 'green',
                    strokeWidth: 1,
                    transition: {
                        fillColor: { duration: 300 },
                        strokeColor: { 
                            duration: 300,
                            delay: 100
                        }
                    }
                },
                'road_main': {
                    fillColor: 'white',
                    lineWidth: 1
                },
                'building': {
                    fillColor: '#333333',
                    fillOpacity: 0.8,
                    strokeColor: '#555555',
                    strokeWidth: 3
                }
            }
        }
    }
    

    Buckets

    Bucket structure

    - Nest buckets under sources, such as streets. This avoids unneeded repetition. - Allow for 'child' buckets that filter the parent bucket. These filters should support multiple dimensions, such as:
    filter: {
        'class': ['motorway', 'motorway_link'],
        'oneway': 1
    }
    
    • Specify type using fill: true or line: { cap: 'round', join: 'bevel' }

    Multiple types in buckets

    Specifying multiple types in a bucket can alleviate a lot of the confusion around line casings and fill strokes, cut down on repeating bucket code, more closely resemble carto patterns, and most importantly, remove the need for multiple layers pointing at a single bucket.

    • Allow for stroke control on fill buckets, which can later be styled in classes, such as:
    'building': {
        layer: 'building',
        fill: true
        stroke: {
            cap: 'round',
            join: 'round'
        }
    }
    
    • Allow for points and text to be specified in a single bucket:
    'poi_park': {
        filter: { 'maki': 'park' }
        point: true,
        text: {
            textField: 'name',
            path: 'curve',
            font: 'Open Sans',
            fontSize: 18
        }
    }
    

    Structure

    By baking multiple types in bucket specification and solving for the road casing issue in the class (see layer updates below), there doesn't seem to be a need for multiple layers pointing to a bucket. We can move to a flatter array for the structure:

    structure: [
        'wetland',
        'poi',
        'poi_park',
        'poi_other',
        { 
            composite: 'road',
            layers: [
                'road_motorway',
                'road_main'
            ] 
        },
        'building'
    ]
    

    This requires layer names to match up with bucket names.

    Layers

    - Rename classes to layers. - Use type-prepended style properties when appropriate. - Every layer has a fillColor property regardless of type. - Images on points use pointImage and tiled patterns on fills use pattern. - Properties such as translate are type-prepended: textTranslate: [40, 0] - Line casings are solved using stroke: strokeWitdth, strokeColor, strokeOpacity, etc. - Transition propertied are grouped like:
    transition: {
        fillColor: { duration: 300 },
        strokeColor: { 
            duration: 300,
            delay: 100
        }
    }
    

    With these changes, I tried to cover all current functionality while simplifying the process conceptually.

    cc @nickidlugash @ansis @mourner @kkaefer @tmcw

    opened by edenh 66
  • Add webpack support

    Add webpack support

    I'm able to bundle gl-js using webpack, but I'm getting a runtime error (in glify) with Chrome 46 on OSX. @tmcw mentioned this has been reported before and that a webpack alternative to glify may be needed. Adding an issue for reference and noting workaround.

    Uncaught TypeError: Cannot read property 'match' of undefined
    

    at https://github.com/mapbox/glify/blob/master/index.js#L13

    Simple example showing my work -- https://github.com/twelch/react-mapbox-gl-js/tree/webpack-test One workaround is to shim with the pre-built gl-js library using the webpack script-loader module.

    require("script!mapbox-gl/dist/mapbox-gl.js");
    

    instead of

    import mapboxgl from 'mapbox-gl';
    
    feature :green_apple: workflow :nail_care: 
    opened by twelch 65
  • Build fails when using mapbox-gl webpack 2 and UglifyJSPlugin

    Build fails when using mapbox-gl webpack 2 and UglifyJSPlugin

    mapbox-gl-js version: 0.32.1

    Steps to Trigger Behavior

    Set up Mapbox with webpack 2 via vuejs-template

    Configuration is as follows: Base: https://gist.github.com/henningko/5a76d12a14e485bfc4dd62c2e50ad08e Production: https://gist.github.com/henningko/3387f41a55558af60205ea00bbc6b530

    Mapbox is used with import mapboxgl from 'mapbox-gl'.

    Expected Behavior

    Mapbox can be successfully uglified.

    Actual Behavior

    When building for production, UglifyJS2 has Mapbox throw a Uncaught ReferenceError: n is not defined. This error also occurs when using Google Closure instead of UglifyJS. May be related to #1649 , which mainly treats webpack v1 and is closed.

    Thanks for your help!

    opened by henningko 62
  • #1231 Use polygon centroid for 'point' symbol placements

    #1231 Use polygon centroid for 'point' symbol placements

    For Issue #1231. This is a first pass that uses a slightly modified centroid function from turf-centroid.js

    It works great for simple polygons, but it doesn't handle holes or complex polygons.

    For holes, maybe the solution would be to look at using the formula for geometric decomposition

    For complex polygons (e.g. river polygons ) a more complex straight polygon tree could be used but I haven't found a nicie clean fast solution for that yet.

    This is also my first PR for mapbox-gl-js, so please let me know if I have missed something.

    opened by blanchg 50
  • Refactor Source interface to allow/prepare for extensibility

    Refactor Source interface to allow/prepare for extensibility

    Replaces #2648

    • Inverts TilePyramid and Source dependencies. TilePyramid now essentially serves as a common wrapper class for dealing with sources.
    • Renames TilePyramid to SourceCache. This is partly aspirational, and partly to make it more reasonable to have things called source that are actually TilePyramids 😁
    • Eliminates the ability to create a Source independently of a Map instance - i.e., no more new mapboxgl.GeoJSONSource(); sources must be created with map.addSource(id, json).
    • Eliminates bucketStats, as it is no longer needed (so @lucaswoj assures me)
    • Source types are now classes with constructor signature (id, options, dispatcher) => Source and an optional workerSourceURL static property
    • The Source provided by the factory function is an object implementing:
    id: string
    tileSize: number
    minzoom: number
    maxzoom: number
    roundZoom: boolean
    reparseOverscaled: boolean
    isTileClipped: boolean
    
    loadTile: (tile: Tile, cb: (err, ?data) => void) => void
    abortTile: (tile: Tile) => void
    unloadTile: (tile: Tile) => void
    serialize: () => Object // plain JS
    ?prepare: () => void
    
    // @fires `load` to indicate source data has been loaded, so that it's okay to call `loadTile`
    // @fires `change` to indicate source data has changed, so that any current caches should be flushed 
    
    • WorkerSourceURL points to a script, which, when executed in the worker thread, must call self.registerWorkerSource(WorkerSource), where WorkerSource is a class that the worker will construct with new WorkerSource(actor, styleLayers).

    WorkerSource instances may implement a loadTile method; if they do, then this will be used by the worker when its 'load tile' target is invoked with a type: 'source-type' parameter (e.g. type: 'geojson'). Any other methods on workerSource instance can be targeted by the main-thread Source via dispatcher.send('source-type.methodname', params, callback).

    Questions:

    • [x] Does the above design have broad (enough) approval?
    • [x] The Tile objects are used by various source types to maintain tile-specific state; ideally, this implicit contract between TilePyramid and Source should be made explicit in the Source interface... but I think this is perhaps out of scope for this particular PR - perhaps this would be naturally addressed in #2703, or else could be ticketed separately?
    • [x] I'm not sure what the data yielded by loadTile should look like. Currently, the only thing I can see being needed by code outside of the particular source is bucketStats, which the pyramid uses to emit the tile.stats event. @lucaswoj can you weigh on in this?

    Remaining Tasks:

    • [x] Video source - @lucaswoj if you can help me get this working, I'm assuming I can probably then manage Image source.
    • [x] Image source
    • [x] Settle Geojson Source design
    • [x] Document the Source interface
    • [x] Document WorkerSource
    • [x] Document addSourceType -- includes documenting the create function and the self.registerWorkerSource(...) requirement on WorkerSource modules.
    • [x] Document "How to implement a source type" -- there's probably a bit more to say beyond the Source, WorkerSource, and addSourceType. Perhaps an example of a 3rd-party source type would suffice. update: went with a link to https://github.com/developmentseed/mapbox-gl-topojson in the docs for GeoJSONWorkerSource.
    • [x] Update docs for ImageSource, VideoSource, GeoJSONSource to reflect that their constructors are no longer publicly available
    • [x] Fix any test regressions
    • [x] Add new unit tests as appropriate
    • [x] Cleanup - drop async loading of core source types, and do it in the "right" place.
    • [x] Cleanup - geojson is a core source type, and so I think we should hard-code require its worker source implementation directly in worker.js--in addition to avoiding the function (self) {} wrapper, it would be silly to webworkify it and waste time at runtime sending that code to all the worker threads
    • [x] Cleanup - move loadTileJSON, queryRenderedFeatures, and querySourceFeatures out of source.js
    • [x] Cleanup - fix upstream bug in WebWorkify
    • [x] Cleanup - hunt & remove all TODO
    opened by anandthakker 50
  • Support property aggregation on clustered features

    Support property aggregation on clustered features

    Hello, I've started exploring this lib and have a feature request: Provide reduce function(s) to clustering configuration, so it's possible to filter clusters by aggregated properties rather than just point_count.

    feature :green_apple: 
    opened by vibze 49
  • Support for getBounds with conic and thematic projections

    Support for getBounds with conic and thematic projections

    Fixes https://github.com/mapbox/gl-js-team/issues/494

    In some projections, the straight edges of the screen become curved when transformed into Mercator space. This issue is most noticeable in conic projections like Albers.

    This PR introduces a new function _getBoundsProjection() which checks 19 points along each edge in addition to the corners (20 * 4 = 80 points total), the extremums of all of them forming the bounds. This is the same approach used in the debug page introduced in https://github.com/mapbox/mapbox-gl-js/pull/12199, and is distinct from the recursive error-checking approach introduced for globe in https://github.com/mapbox/mapbox-gl-js/pull/12286. Because projecting a screen point (called in pointLocation) in non-globe projections is a faster operation (in globe or with terrain it requires raytracing), I think the increase in point count is acceptable.

    Albers:

    Before:

    image

    After:

    image

    Equal Earth:

    Before:

    image

    After:

    image

    Launch Checklist

    • [X] briefly describe the changes in this PR
    • [X] include before/after visuals or gifs if this PR includes visual changes
    • [x] write tests for all new functionality
    • [ ] document any changes to public APIs
    • [x] manually test the debug page
    • [X] apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
    • [X] add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Fix map.getBounds returning incorrect bounds with adaptive projections.</changelog>
    feature :green_apple: 
    opened by SnailBones 7
  • `map.fitBounds` does not account for padding options when used with globe projection

    `map.fitBounds` does not account for padding options when used with globe projection

    I am making a globe where countries of the world can be highlighted. I am adding a padding to the map (shown using showPadding-debug), and moving the map using fitBounds like this:

    map.current.fitBounds( [ [west, south], [east, north] ], { duration: ANIMATION_TIME, easing: easeInOutCubic } );

    The bounds sent to fitBounds are the same used to draw the blue-ish area in the video.

    When clicking smaller countries this works like a charm, but there are major issues on larger areas like USA and Russia, and also when selecting countries near the north pole (Norway). There are completely viable configurations of zoom and translation available, like I am trying to illustrate in the video by manually moving/scaling the wrongly positioned areas.

    Am I doing something wrong here, or is fitBounds simply not adapted completely for globe-projections?

    https://user-images.githubusercontent.com/715134/210360341-dfb02601-17bf-4a1c-9584-795794fbc368.mp4

    bug :lady_beetle: 
    opened by simengjermundsen 7
  • Fix

    Fix "undefined is not an object" in coalesceChanges

    This PR fixes #11784, by implementing the change suggested by @mourner. A/B tested against published npm package and local build. Bug did not occur in local build with these changes.

    Launch Checklist

    • [x] briefly describe the changes in this PR (above)
    • [ ] include before/after visuals or gifs if this PR includes visual changes
    • [ ] write tests for all new functionality
    • [x] document any changes to public APIs (none)
    • [ ] post benchmark scores
    • [ ] manually test the debug page
    • [x] apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
    • [x] add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Fixes "undefined is not an object" in coalesceChanges</changelog>
    opened by nick-romano 1
  • Converting vt-geojson back to standardized geojson for use in turf

    Converting vt-geojson back to standardized geojson for use in turf

    Question

    I am trying to transform the output of supercluster with turf, but since supercluster.getTile() returns a "vt-geojson" and turf expects a standardized geojson it won't compute. Which library is used to fill in this gap?

    I tried [1] but it throws some internal errors. Is this up to date?

    The library for geojson-vt[2] only provides methods for converting FROM geojson, but not TO geojson.

    My previous flow was as follows: features[] -> supercluster: vt-geojson -> vt-pbf:pbf and expose this as tiled vector layer to mapbox-gl-js

    Now I want to use turf and apply some transformations after supercluster, before sending to the client via vt-pbf.

    What is the recommended way of doing this?

    Thanks.

    Links to related documentation

    [1] https://github.com/mapbox/vector-tile-js [2] https://github.com/mapbox/geojson-vt

    opened by doebi 0
  • Fill pattern behaviour

    Fill pattern behaviour

    Hello Team,

    I am building a map where there are thousands of small polygons, each with a background picture. Tried fill-pattern but this keeps repeating images over different zoom levels.

    Just wondering if it is possible to create a new pattern from a sprite image that does not repeat but instead covers the polygon in question?

    If not, any suggestion on how to accomplish this?

    Thank you!

    opened by zned45 0
  • Can the text padding parameter be added as a parameter for calculating the text placement position?

    Can the text padding parameter be added as a parameter for calculating the text placement position?

    When you set Label.anchor, the icon and label overlap. image Maybe it can be solved by that add the text padding parameteras a parameter for calculating the text placement position?

    opened by longhaiyan-lhy 0
Releases(v2.12.0)
  • v2.12.0(Jan 4, 2023)

    Features ✨ and improvements 🏁

    • Improve performance of patterns and line dashes and improve their appearance when zooming. (#12326)
    • Improve performance of text and icon placement. (#12351)
    • Improve performance of loading terrain data (#12397)
    • Allow zooming towards terrain at a safe distance without pitching the camera (#12354)
    • Allow for pitch override in cameraForBounds, fitBounds and fitScreenCoordinates camera APIs. (#12367)

    Bug fixes 🐞

    • Fix getBounds when used around the poles with a globe projection. (#12315)
    • Fix incorrect transition flag in *-pattern and line-dasharray properties (#12372)
    • Fix symbols filtering when using center-to-distance along with terrain. (#12413)
    • Fix fog rendering artifact on lower resolution terrain tiles (#12423)
    • Fix an issue where Geolocate control would throw an error if it's removed before determining geolocation support (#12332) (h/t tmcw)
    Source code(tar.gz)
    Source code(zip)
  • v2.12.0-beta.1(Dec 15, 2022)

  • v2.11.1(Dec 6, 2022)

  • v2.11.1-beta.1(Nov 21, 2022)

  • v2.11.0(Nov 14, 2022)

    Features ✨ and improvements 🏁

    • Add support for cameraForBounds with globe projection (#12138)
    • Add support for fitBounds and fitScreenCoordinates with globe projection (#12211)
    • Improve support for getBounds with globe projection. (#12286)
    • Improve symbol placement performance with globe projection (#12105)
    • Add new marker styling option occludedOpacity allowing the user to set the opacity of a marker that's behind 3D terrain (h/t jacadzaca) (#12258)
    • Cancel ImageSource image request when underlying resource is no longer used (#12266) (h/t maciejmatu)
    • Add object literal support in LngLatBounds.extend (#12270) (h/t stampyzfanz)
    • Add live performance counters. Mapbox-gl-js v2.11.0 collects certain performance and feature usage counters so we can better benchmark the library and invest in its performance. The performance counters have been carefully designed so that user-level metrics and identifiers are not collected. (#12343)

    Bug fixes 🐞

    • Fix elevation of pole geometry when exaggerated terrain is used (#12133)
    • Fix GeolocateControl sometimes not working in iOS16 WebView (#12239)
    • Fix map crashing on conformal projections at the south pole (#12172)
    • Fix pixel flickering between tiles on darker styles in globe view. (#12145)
    • Fix occasional missing tiles at bottom of screen during globe-mercator transition (#12137)
    • Fix incorrectly requiring three finger drags to change pitch with cooperative gestures while in fullscreen. (#12165)
    • Fix jumping when scrolling with mouse when crossing the antimeridian on projections that wrap. (#12238)
    • Fix terrain error being fired when using map.getStyle() with globe view (#12163)
    • Fix occasional artifacts appearing in the ocean with terrain or globe enabled. (#12279)
    • Fix invalid AABB calculation as part of the globe tile cover (#12207)
    • Fix incorrect shading of corners in fill extrusions when ambient occlusion is enabled. (#12214)
    • Fix potential performance regression on image source updates (#12212)
    • Fix memory leak when removing maps (#12224) (h/t joewoodhouse)
    • Fix updating marker position when toggling between world copied projections and projections without (#12242)
    • Fix missing icons in some styles. (#12299)
    • Fix overwriting all feature ids while setting promoteIds on other layers with an object. (#12322) (h/t yongjun21)
    • Fix cursor returning to original state after a popup with trackPointer is removed (#12230) (h/t camouflagedName)
    Source code(tar.gz)
    Source code(zip)
  • [email protected](Nov 14, 2022)

  • v2.11.0-beta.2(Nov 7, 2022)

  • v2.11.0-beta.1(Oct 21, 2022)

  • v2.10.0(Aug 23, 2022)

    Features ✨ and improvements 🏁

    • Add new marker styling option rotationAlignment: 'horizon' allowing marker rotation to match the curvature of the horizon in globe view (#11894)
    • Improve panning precision on Globe View and relax constraints on lower zoom levels (#12114)
    • Add unit option to number-format expression (#11839) (h/t varna)
    • Add screen reader alert for cooperative gestures warning message. (#12058)
    • Improve rendering performance on globe view (#12050)
    • Improve tile loading performance on low zoom levels (#12061)
    • Improve globe-mercator transition and map load performance with globe projection (#12039)

    Bug fixes 🐞

    • Fix a bug where id expression didn't correctly handle a value of 0 (#12000)
    • Fix precision errors in depth pack/unpack (#12005)
    • Fix cooperativeGestures preventing panning on mobile while in fullscreen. (#12058)
    • Fix misplaced raster tiles after toggling setStyle with a globe projection (#12049)
    • Fix exception on creating map in an iframe with sandbox attribute. (#12101)
    • Fix "improve map" link in the attribution to include location even if map hash is disabled (#12122)
    • Fix Chrome console warnings about ignored event cancel on touch interactions (#12121) (h/t jschaf)
    Source code(tar.gz)
    Source code(zip)
  • [email protected](Aug 23, 2022)

  • v2.10.0-beta.1(Aug 12, 2022)

  • v2.9.2(Jul 14, 2022)

  • v2.9.1(Jun 20, 2022)

  • v2.9.0(Jun 17, 2022)

    Features ✨

    • Add globe projection. This new projection displays the map as a 3d globe and can be enabled by either passing projection: globe to the map constructor or by calling map.setProjection('globe'). All layers are supported by globe except for Custom Layers and Sky.
    • Extend atmospheric fog with three new style specification properties: high-color, space-color and star-intensity to allow the design of atmosphere around the globe and night skies. (#11590)
    • Add a new line layer paint property in the style specification: line-trim-offset that can be used to create a custom fade out with improved update performance over line-gradient. (#11570)
    • Add an option for providing a geolocation adapter to GeolocateControl. (#10400) (h/t behnammodi)
    • Add Map.Title property to locale options to localise the map aria-label. (#11549) (h/t andrewharvey)
    • Allow duplicated coordinates in tile request URLs. (#11441) (h/t ozero)

    Bug fixes 🐞

    • Fix an issue which causes line layers to occasionally flicker. (#11848)
    • Fix markers in fog sometimes becoming more visible when behind terrain. (#11658)
    • Fix an issue where setting terrain exageration to 0 could prevent the zoom to be resolved. (#11830)
    • Copy stylesheet to allow toggling different styles using setStyle without overwriting some of the properties. (#11942)
    Source code(tar.gz)
    Source code(zip)
  • [email protected](Jun 17, 2022)

    Features ✨

    • Extend atmospheric fog with three new style specification properties: high-color, space-color and star-intensity to allow the design of atmosphere around the globe and night skies. (#11590)
    • Add a new line layer paint property in the style specification: line-trim-offset that can be used to create a custom fade out with improved update performance over line-gradient. (#11570)

    🐞 Bug fixes

    • Add source field requirement to terrain exaggeration in the style specification. (#11664)
    Source code(tar.gz)
    Source code(zip)
  • v2.9.0-beta.2(Jun 8, 2022)

  • v2.9.0-beta.1(May 13, 2022)

  • v2.8.2(Apr 22, 2022)

    Bug fixes 🐞

    • Fix an issue where the special bundle for CSP-restricted environments was not compatible with further minification in some bundling setups. (#11790)
    Source code(tar.gz)
    Source code(zip)
  • v2.8.1(Apr 13, 2022)

  • v2.8.0(Apr 7, 2022)

    Performance improvements 🏁

    • Improve memory usage by freeing memory more eagerly after loading tiles. (#11434)
    • Improve memory usage by reducing repeated line labels on overscaled tiles. (#11414)
    • Improve performance when placing many symbols on terrain. (#11466)

    Bug fixes 🐞

    • Fix map.fitBounds(), map.fitScreenCoordinates(), and map.cameraForBounds() incorrectly matching bounds with non-zero bearing. (#11568) (h/t TannerPerrien)
    • Improve control button appearance by applying border-radius more consistently. (#11423) (h/t nagix)
    • Fix ScaleControl displaying incorrect units with some projections.(#11657)
    • Fix performance regression when animating image sources. (#11564)
    • Fix MapDataEvent.isSourceLoaded() to check if specific source has loaded. (#11393)
    • Fix map not wrapping after moving the map with no inertia. (#11448)
    • Fix popup not removing event listeners when closeOnClick:true. (#11540)
    • Fix camera occasionally intersecting terrain when DEM data loads while zooming. (#11461, #11578)
    • Increase clarity of line layers with the terrain on high DPI devices. (#11531)
    • Fix canvas size if more than one parent container has a transform CSS property. (#11493)
    • Fix error on calling map.removeImage() on animated image. (#11580)
    • Fix occasional issue with fill-extrusion layers not rendering on tile borders when used with terrain. (#11530)

    Workflow πŸ› οΈ

    • Upgrade Flow from v0.108.0 to v0.142.0 and enable type-first mode, greatly improving performance of type-checking. (#11426)
    Source code(tar.gz)
    Source code(zip)
  • [email protected](Apr 7, 2022)

  • v2.8.0-beta.1(Mar 24, 2022)

  • v2.7.1(Mar 18, 2022)

  • v2.7.0(Jan 31, 2022)

    Features ✨ and improvements 🏁

    • Enable preloading tiles for camera animation. (#11328)
    • Improve quality of transparent line layers by removing overlapping geometry artifacts. (#11082). Note: removing that feature can be done by using the line color alpha channel, e.g. line-color: "rgba(r, g, b, 0.5)" instead of line-opacity.
    • Add perspective correction for non-rectangular image, canvas and video sources. (#11292)
    • Improve performance of default markers. (#11321)
    • Add marker methods setSnapToPixel and getSnapToPixel to indicate rounding a marker to pixel. (#11167) (h/t malekeym)
    • Add a default aria-label for interactive markers for improved user accessibility. (#11349)
    • Add support for sparse tile sets to DEM data sources, when served tiles don't go up to the full maxzoom. (#11276)
    • Allow users to set order of custom attribution. (#11196)
    • Add function call chaining to function map.setProjection (#11279) (h/t lpizzinidev)

    🐞 Bug fixes

    • Fix canvas size to evaluate to expected value when applying the CSS transform property. (#11310)
    • Fix getBounds sometimes returning invalid LngLat when zooming on a map with terrain. (#11339) (h/t @ted-piotrowski)
    • Fix rendering of denormalized strings with diacritics. (#11269)
    • Remove redundant title attribute from Improve this Map attribution element. (#11360)
    • Fix a rare terrain flickering issue when using terrain with multiple vector data sources. (#11346)
    Source code(tar.gz)
    Source code(zip)
  • [email protected](Jan 31, 2022)

Owner
Mapbox
Mapbox is the location data platform for mobile and web applications. We're changing the way people move around cities and explore our world.
Mapbox
Demo of Singapore buildings 3D tiles from OneMap on Mapbox GL JS.

Singapore buildings 3D Tiles from OneMap 3D on Mapbox GL JS This is a demo of Singapore buildings 3D tiles from OneMap 3D on Mapbox GL JS. Development

Chee Aun 5 Nov 6, 2021
:leaves: JavaScript library for mobile-friendly interactive maps

Leaflet is the leading open-source JavaScript library for mobile-friendly interactive maps. Weighing just about 39 KB of gzipped JS plus 4 KB of gzipp

Leaflet 36.5k Jan 1, 2023
Polymaps is a free JavaScript library for making dynamic, interactive maps in modern web browsers.

Polymaps Polymaps is a free JavaScript library for making dynamic, interactive maps in modern web browsers. See http://polymaps.org for more details.

Urban Airship 1.6k Dec 23, 2022
Serverless raster and vector map tile generation using Mapnik and AWS Lambda

tilegarden ??️ ?? Contents About Usage Deployment to AWS Additional Configuration Options Required AWS Permissions Features Configuration Selection an

Azavea 89 Dec 22, 2022
jQuery Vector Map Library

This project is a heavily modified version of jVectorMap as it was in April of 2012. I chose to start fresh rather than fork their project as my inten

10 Best Design 1.8k Dec 28, 2022
jQuery Vector Map Library

This project is a heavily modified version of jVectorMap as it was in April of 2012. I chose to start fresh rather than fork their project as my inten

10 Best Design 1.8k Dec 28, 2022
JavaScript WebGL 3D map rendering engine

VTS Browser JS is a powerful JavaScript 3D map rendering engine with a very small footprint (about 163 kB of gziped JS code). It provides almost all f

Melown Technologies, SE 203 Dec 7, 2022
An online tool to generate and visualize maps for irregular and/or gapped LED layouts, for use with FastLED, Pixelblaze and other libraries.

An online tool to generate and visualize maps for irregular and/or gapped LED layouts, for use with FastLED, Pixelblaze and other libraries.

Jason Coon 172 Dec 8, 2022
An open-source JavaScript library for world-class 3D globes and maps :earth_americas:

CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin. It uses WebGL for hardware-accelerated graphics

Cesium 9.7k Dec 26, 2022
An open-source JavaScript library for world-class 3D globes and maps :earth_americas:

CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin. It uses WebGL for hardware-accelerated graphics

Cesium 9.7k Jan 3, 2023
Converts geojson to svg string given svg viewport size and maps extent.

geojson2svg Converts geojson to svg string given svg viewport size and maps extent. Check world map, SVG scaled map and color coded map examples to de

Gagan Bansal 163 Dec 17, 2022
Dashboards-maps is a frontend plugin that helps you in uploading custom GeoJSON to OpenSearch and communicates with the geospatial backend plugin for the same.

Welcome! Project Resources Code of Conduct License Copyright Dashboards-Maps Dashboards-maps is a frontend plugin that helps you in uploading custom G

null 9 Dec 28, 2022
the easiest way to use Google Maps

Important If you're developer, I'm moving gmaps.js to NPM, you can give your opinion and check the migration progress in Issue #404 gmaps.js - A Javas

Gustavo Leon 7.1k Dec 28, 2022
UNMAINTAINED Open source JavaScript renderer for Kartograph SVG maps

This project is not maintained anymore. Here are a few reasons why I stopped working on kartograph.js: there's no need to support non-SVG browsers any

null 1.5k Dec 11, 2022
the easiest way to use Google Maps

Important If you're developer, I'm moving gmaps.js to NPM, you can give your opinion and check the migration progress in Issue #404 gmaps.js - A Javas

Gustavo Leon 7.1k Apr 7, 2021
This is a collection of over two hundred code samples an growing for the Bing Maps V8 web control.

Bing Maps V8 Code Samples This is a collection of over a hundred code samples for the Bing Maps V8 web control. These samples have been collected from

Microsoft 130 Dec 8, 2022
This project contains the TypeScript definitions for the Bing Maps V8 Web Control.

Bing Maps V8 TypeScript Definitions These are the official TypeScript definitions for the Bing Maps V8 Web Control. These can be used to provide intel

Microsoft 35 Nov 23, 2022
React components for Leaflet maps

React Leaflet React components for Leaflet maps. Documentation Getting started API reference Changes See the CHANGELOG file. Contributing See the CONT

Paul Le Cam 4.4k Jan 3, 2023
Vue 2 components for Leaflet maps

Vue2Leaflet Vue2Leaflet is a JavaScript library for the Vue framework that wraps Leaflet making it easy to create reactive maps. How to install npm in

Vue Leaflet 1.9k Dec 29, 2022