All Projects → Mappy → Leaflet-active-area

Mappy / Leaflet-active-area

Licence: Apache-2.0 License
A Leaflet plugin to center the map not in the center of the map but inside a DIV. Useful for responsive design.

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Leaflet-active-area

Iclient Javascript
Modern GIS Web Client for JavaScript, based on Leaflet\OpenLayers\MapboxGL-JS\Classic(iClient8C), enhanced with ECharts\D3\MapV etc. Contributed by SuperMap & community.
Stars: ✭ 593 (+498.99%)
Mutual labels:  map, leaflet, leaflet-plugins
Leaflet.markercluster
Marker Clustering plugin for Leaflet
Stars: ✭ 3,305 (+3238.38%)
Mutual labels:  map, leaflet, leaflet-plugins
leaflet-layer-tree-plugin
No description or website provided.
Stars: ✭ 31 (-68.69%)
Mutual labels:  map, leaflet
vaguely-rude-places
The map of Vaguely Rude Place Names
Stars: ✭ 19 (-80.81%)
Mutual labels:  map, leaflet
MinedMap
Minecraft map renderer and viewer
Stars: ✭ 35 (-64.65%)
Mutual labels:  map, leaflet
leaflet-tag-filter-button
Adds tag filter control for layers (marker, geojson features etc.) to LeafLet.
Stars: ✭ 48 (-51.52%)
Mutual labels:  map, leaflet
leaflet.minichart
Leaflet.minichart is a leaflet plugin for adding to a leaflet map small animated charts
Stars: ✭ 27 (-72.73%)
Mutual labels:  map, leaflet
leaflet heatmap
简单的可视化湖州通话数据 假设数据量很大,没法用浏览器直接绘制热力图,把绘制热力图这一步骤放到线下计算分析。使用Apache Spark并行计算数据之后,再使用Apache Spark绘制热力图,然后用leafletjs加载OpenStreetMap图层和热力图图层,以达到良好的交互效果。现在使用Apache Spark实现绘制,可能是Apache Spark不擅长这方面的计算或者是我没有设计好算法,并行计算的速度比不上单机计算。Apache Spark绘制热力图和计算代码在这 https://github.com/yuanzhaokang/ParallelizeHeatmap.git .
Stars: ✭ 13 (-86.87%)
Mutual labels:  map, leaflet
esri-leaflet-vector
Display ArcGIS Online vector basemaps w/ Esri Leaflet
Stars: ✭ 39 (-60.61%)
Mutual labels:  leaflet, leaflet-plugins
mars2d
【Mars2D平台 】主仓库,包含所有开源仓库清单导航
Stars: ✭ 182 (+83.84%)
Mutual labels:  map, leaflet
mapus
A map tool with real-time collaboration 🗺️
Stars: ✭ 2,687 (+2614.14%)
Mutual labels:  map, leaflet
leaflet.tilelayer.gloperations
Custom Leaflet TileLayer using WebGL to do operations on and colorize floating-point pixels
Stars: ✭ 15 (-84.85%)
Mutual labels:  leaflet, leaflet-plugins
harp-leaflet
Leaflet plugin for harp.gl
Stars: ✭ 16 (-83.84%)
Mutual labels:  leaflet, leaflet-plugins
coronavirus-map-dashboard
🦠 Coronavirus (COVID-19) Map Dashboard using coronavirus-tracker-api
Stars: ✭ 41 (-58.59%)
Mutual labels:  map, leaflet
Leaflet.MarkerCluster.LayerSupport
Sub-plugin for Leaflet.markercluster plugin; brings compatibility with Layers Control and other plugins
Stars: ✭ 53 (-46.46%)
Mutual labels:  leaflet, leaflet-plugins
leaflet-area-select
Control to just select an area and provide bbox for it
Stars: ✭ 27 (-72.73%)
Mutual labels:  leaflet, leaflet-plugins
papyruscs
PapyrusCS renders maps of Minecraft: Bedrock Edition worlds using C#, LevelDB and leaflet.
Stars: ✭ 221 (+123.23%)
Mutual labels:  map, leaflet
django-leaflet-admin-list
The Django Leaflet Admin List package provides an admin list view featured by the map and bounding box filter for the geo-based data of the GeoDjango.
Stars: ✭ 28 (-71.72%)
Mutual labels:  map, leaflet
leaflet-defaulticon-compatibility
Retrieve all Leaflet Default Icon options from CSS, in particular all icon images URL's, to improve compatibility with bundlers and frameworks that modify URL's in CSS.
Stars: ✭ 71 (-28.28%)
Mutual labels:  leaflet, leaflet-plugins
Leaflet.TileLayer.Fallback
Replaces missing Tiles by scaled lower zoom Tiles
Stars: ✭ 29 (-70.71%)
Mutual labels:  leaflet, leaflet-plugins

Leaflet-active-area Build Status

That Leaflet plugin allows you to use a DIV as the active area. All positionning methods (setView, fitBounds, setZoom) will be applyed on this DIV instead of the all map. A typical use case is to set a map as background (like that example) and center it on the top of the screen for example. Defining media queries on that DIV make it easy to adapt the active area according client resolution.

Demo

Try the example page !

Usage

Include the javascript file :

<script src="L.activearea.js"></script>

Add a CSS class (".activeArea" in that example) with absolute position

.activeArea { position: absolute; top: 50px; left: 50px; right: 50px; height: 200px; }

And instanciate your map like that :

var map = new L.Map(document.createElement('div')).setActiveArea('activeArea');

You can also give an object with HTML style properties:

var map = new L.Map(document.createElement('div')).setActiveArea({
    position: 'absolute',
    top: '50px',
    left: '50px',
    right: '50px',
    height: '200px'
});

Then, the map will center itself in the center of that DIV when calling setView, setZoom, fitBounds, etc.

If your need to re-center the map automatically, pass 'true' as second argument :

map.setActiveArea('activeArea', true, true);

Pass true as 3rd argument to animate the pan (default = false)

Pre-commit hook

To install the pre-commit hook (which launch tests): ln -s ../../pre-commit.sh .git/hooks/pre-commit

Contributors

Thanks to all contributors : https://github.com/Mappy/Leaflet-active-area/graphs/contributors

License

This code is provided under the Apache 2.0 license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].