# mapbox-gl-inspect **Repository Path**: eag/mapbox-gl-inspect ## Basic Information - **Project Name**: mapbox-gl-inspect - **Description**: No description available - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-10-18 - **Last Updated**: 2023-10-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Mapbox GL Inspect [](https://travis-ci.org/lukasmartinelli/mapbox-gl-inspect) Add an inspect control to [Mapbox GL JS](https://github.com/mapbox/mapbox-gl-js) to view all features of the vector sources and allows hovering over features to see their properties. **Requires [mapbox-gl-js](https://github.com/mapbox/mapbox-gl-js) (version 0.29.0 – 0.31.x).**  ## Usage **mapbox-gl-inspect** is a [Mapbox GL JS plugin](https://www.mapbox.com/blog/build-mapbox-gl-js-plugins/) that you can easily add on top of your map. Check `index.html` for a complete example. Make sure to include the CSS and JS files. **When using a CDN** ```html ``` **When using modules** ```js require('mapbox-gl-inspect/dist/mapbox-gl-inspect.css'); var mapboxgl = require('mapbox-gl'); var MapboxInspect = require('mapbox-gl-inspect'); // Pass an initialized popup to Mapbox GL map.addControl(new MapboxInspect({ popup: new mapboxgl.Popup({ closeButton: false, closeOnClick: false }) })); ``` ### Add Inspect Control Add the inspect control to your map. ```javascript map.addControl(new MapboxInspect()); ``` ### Show Inspection Map Switch to the inspection map by default. ```javascript map.addControl(new MapboxInspect({ showInspectMap: true })); ``` ### Show only Inspection Mode Switch to the inspection map by default and hide the inspect button to switch back to the normal map. Check [`examples/inspect-only.html`](http://mapbox-gl-inspect.lukasmartinelli.ch/examples/inspect-only.html). ```javascript map.addControl(new MapboxInspect({ showInspectMap: true, showInspectButton: false })); ``` ### Disable Popup Disable the feature Popup in inspection mode and in map mode. Check [`examples/no-popup.html`](http://mapbox-gl-inspect.lukasmartinelli.ch/examples/no-popup.html). ```javascript map.addControl(new MapboxInspect({ showInspectMapPopup: false, showMapPopup: false })); ``` ### Custom Popup Function You can also control the Popup output. Check [`examples/custom-popup.html`](http://mapbox-gl-inspect.lukasmartinelli.ch/examples/custom-popup.html). ```javascript map.addControl(new MapboxInspect({ renderPopup: function(features) { return '