Leaflet

所属分类:GIS/地图编程
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2019-09-30 01:46:04
上 传 者sh-1993
说明:  一个小册子控件,用于显示地图中心的坐标,在移动触摸设备上特别有用,
(A Leaflet control to display the coordinates of the map center, especially useful on mobile touch devices,)

文件列表:
.npmignore (0, 2016-08-28)
Gruntfile.js (1002, 2016-08-28)
LICENCE (1079, 2016-08-28)
examples/ (0, 2016-08-28)
examples/ddmm.html (1138, 2016-08-28)
examples/ddmmss.html (1110, 2016-08-28)
examples/etrs89-31n.html (2042, 2016-08-28)
examples/latlng_formatter.html (1521, 2016-08-28)
examples/lib/ (0, 2016-08-28)
examples/lib/proj4leaflet.min.js (8074, 2016-08-28)
examples/simple.html (1077, 2016-08-28)
package.json (952, 2016-08-28)
src/ (0, 2016-08-28)
src/L.Control.MapCenterCoord.css (502, 2016-08-28)
src/L.Control.MapCenterCoord.js (7895, 2016-08-28)
src/icons/ (0, 2016-08-28)
src/icons/MapCenterCoordIcon1.svg (3994, 2016-08-28)
src/icons/MapCenterCoordIcon2.svg (2154, 2016-08-28)

# Leaflet.MapCenterCoord A Leaflet control to display the coordinates of the map center, especially useful on **touch/mobile devices**. The initial idea was based on the plugin [Leaflet.MousePosition](https://github.com/ardhi/Leaflet.MousePosition). ## Requirements Leaflet v7.x Tested ok on Leaflet 1.0 beta2 #### Some tested platforms Android 4.4.2: Google Chrome 47 and stock browser iOS 9.2: Safari Desktops: Windows 7, Windows 10, Ubuntu 14.04 LTS Google Chrome 47, Firefox 43, Microsoft Internet Explorer 10, 11 and Edge 25 ## Examples http://xguaita.github.io/Leaflet.MapCenterCoord/ Sources in [/examples](/xguaita/Leaflet.MapCenterCoord/tree/master/examples) folder ## Install + [Download](https://github.com/xguaita/Leaflet.MapCenterCoord/releases/latest) latest release - Source code in `/src` folder - Minified versions in `/dist` + Include js and css files located in the `/dist` folder (production) or `/src` (development) + If you want to change the code and build minified versions: First, install node.js on your system. Then run `npm install` to build the minified js and css into `/dist` ## Usage Add the following line to your map initialization: ``` js L.control.mapCenterCoord().addTo(map); ``` You can also pass a configuration. ## Configuration options The MapCenterCoord control inherits options from [Leaflet Controls](http://leafletjs.com/reference.html#control-options). | Option | Type | Default | Description | --- | --- | --- | --- | position | String | `'bottomleft'` | The standard Leaflet.Control [position parameter](http://leafletjs.com/reference.html#control-positions) | icon | Boolean | `true` | Shows crosshair icon on map center | onMove | Boolean | `false` | Update the coordinates of the map center while dragging | template | String | '{y} | {x}' | Display template | latlngFormat | String | `'DD'` | Show lat/lng coordinates in 3 possible formats:
Decimal degrees `'DD'` (DDD.DDDDD°)
Degrees and decimal minutes `'DM'` (DDD° MM.MMM')
Degrees, minutes and seconds `'DMS'` (DDD° MM' SS.S") | latlngDesignators | Boolean | `false` | Show N-S and E-W | projected | Boolean | `false` | Show projected coordinates | formatProjected | String | `'#.##0,0'` | Number format mask for projected coordinates.
[JavaScript Number Formatter](https://code.google.com/p/javascript-number-formatter/) project: [sample/help page](http://www.integraxor.com/developer/codes/js-formatter/format-sample.htm ) | latLngFormatter | Function | `undefined` | Function that takes the lattitude and longitude as arguments and returns a single formatted string, e.g.
function (lat, lng) {
return lat + " north and " + lng + " west";
}
## License This software is released under the [MIT license](http://opensource.org/licenses/mit-license.php).

近期下载者

相关文件


收藏者