Commit 4a48e3c6 authored by Deployer's avatar Deployer

Imported initial version of CedarMaps vector tiles SDK

parents
# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.zip
*.vi
*~
*.sass-cache
# OS or Editor folders
.DS_Store
._*
Thumbs.db
.cache
.project
.settings
.tmproj
*.esproj
nbproject
*.sublime-project
*.sublime-workspace
.sublime-grunt.cache
access-token.js
# Komodo
*.komodoproject
.komodotools
# Folders to ignore
.hg
.svn
.CVS
.idea
node_modules
dist
# Cedarmaps Web SDK Vector
CedarMaps JS is a javascript library for building interactive maps. It's simply a wrapper for [Mapbox GL Javascript API](https://github.com/mapbox/mapbox-gl-js).
# Table of Contents
- [Basic Usage](#basic-usage)
- [API](#api)
- [map](#map)
- [gl](#gl)
- [api](#api)
# Basic Usage
Recommended usage is via the CedarMaps CDN. Just include CSS and JavaScript files in `<head>` section of your HTML file.
```html
<script src='https://api.cedarmaps.com/cedarmaps-gl.js/v1.0.0/cedarmaps.js'></script>
<link href='https://api.cedarmaps.com/cedarmaps-gl.js/v1.0.0/cedarmaps.css' rel='stylesheet'/>
```
and put the following code in the `<body>` of your HTML file:
```html
<div id='map' style='width: 400px; height: 300px;'></div>
<script type="text/javascript">
var map = CedarMaps.map(accessToken, {
style: 'cedarmaps://styles/light', //or cedarmaps://styles/dark
container: <CONTAINER ID>,
center: <CENTER POINT>,
zoom: 15
});
</script>
```
**Note:** You can get an access token by filling out the demo account form in [Cedarmaps Website](https://www.cedarmaps.com/#demo).
If you prefer to have your local version of the library you can simply build it with the following commands:
**Note:** [node.js](http://nodejs.org/) must be installed on your machine.
```sh
git clone http://gitlab.cedar.ir/cedar.studios/cedarmaps-sdk-web-vector.git
cd cedarmaps-sdk-web-vector
npm install
npx webpack
```
After the built process, the files are copied into `dist/` folder according to current SDK `version`. (See `package.json`).
**Note:** Every time you pull new changes from repository, you should run `npx webpack` again.
```sh
git pull
npx webpack
```
You can also see the [API documentation](hhttps://www.mapbox.com/mapbox-gl-js) for further help.
# API
## map
Create new cedarmaps object base on provided token and options (see [mapbox gl options](https://www.mapbox.com/mapbox-gl-js/api/#map) )
### `CedarMaps.map(ACCESS_TOKEN [, options])`
_Returns_ a `Map box` object.
```javascript
CedarMaps.map(accessToken, {
style: 'cedarmaps://styles/light', //or cedarmaps://styles/dark
container: <CONTAINER ID>,
center: <CENTER POINT>,
zoom: 15
});
```
## gl
Mapbox GL object
```javascript
var marker = new CedarMaps.gl.Marker().setLngLat([51.3789253, 35.709987]).addTo(map)
```
_Example_: Check out a [Live example of address locator](https://demo.cedarmaps.com/websdk-vectoe/demos/basic-map-marker.html).
## api
CedarMaps API. please see [cedarmaps npm package](https://www.npmjs.com/package/cedar-maps) for more information
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8/>
<title>CedarMaps - Basic Map Load with a Marker</title>
<script src='../dist/v1.0.0/cedarmaps.js'></script>
<link href='../dist/v1.0.0/cedarmaps.css' rel='stylesheet'/>
<script src='../access-token.js'></script>
<style>
body {
margin: 0;
padding: 0;
}
.map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div id='map' class='map'></div>
<script>
// initilizing map into div#map
var map = CedarMaps.map(accessToken, {
style: 'cedarmaps://styles/light',
container: 'map',
center: [51.3789253, 35.709987],
zoom: 15,
scrollWheelZoom: true,
zoomControl: false,
minZoom: 7,
maxZoom: 17,
})
/**
* Adding a Leaflet marker with custom image
*/
var element = document.createElement('div')
element.className = 'marker'
element.style.backgroundImage = 'url(./img/pin-taxi.png)'
element.style.width = '34px'
element.style.height = '46px'
var marker = new CedarMaps.gl.Marker(element).setLngLat([51.3789253, 35.709987]).addTo(map)
var controles = new CedarMaps.gl.NavigationControl()
var popup = new CedarMaps.gl.Popup({
closeButton: true,
closeOnClick: true,
offset: [0, -14],
}).setHTML('Hello World!')
.setLngLat([51.3789253, 35.709987])
.addTo(map)
map.addControl(controles)
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8/>
<title>CedarMaps - Basic Map Load with a Marker</title>
<script src='../dist/v1.0.0/cedarmaps.js'></script>
<link href='../dist/v1.0.0/cedarmaps.css' rel='stylesheet'/>
<script src='../access-token.js'></script>
<style>
body {
margin: 0;
padding: 0;
}
.map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div id='map' class='map'></div>
<script>
// initilizing map into div#map
var map = CedarMaps.map(accessToken, {
style: 'cedarmaps://styles/light',
container: 'map',
center: [51.3789253, 35.709987],
zoom: 15,
scrollWheelZoom: true,
zoomControl: false,
minZoom: 7,
maxZoom: 17,
})
/**
* Adding a Leaflet marker with custom image
*/
var element = document.createElement('div')
element.className = 'marker'
element.style.backgroundImage = 'url(./img/pin-taxi.png)'
element.style.width = '34px'
element.style.height = '46px'
var marker = new CedarMaps.gl.Marker(element).setLngLat([51.3789253, 35.709987]).addTo(map)
var popup = new CedarMaps.gl.Popup({
closeButton: true,
closeOnClick: true,
offset:[0,-14],
}).setHTML('Hello World!')
.setLngLat([51.3789253, 35.709987])
.addTo(map)
</script>
</body>
</html>
\ No newline at end of file
body {
margin: 0;
padding: 0;
font-family: Arial,"Helvetica Neue",Helvetica,sans-serif
}
.map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
#results {
width: 400px;
position: absolute;
top: 20px;
left: 50px;
background-color: rgba(255, 255, 255, .95);
border-radius: 5px;
padding: 10px;
font-size: 13px;
}
#loading {
visibility: hidden;
}
#parsed-response {
margin: 20px 0;
direction: rtl;
font: 12px/1.8em;
font-family: Tahoma;
background-color: #f1f1f1;
padding: 10px;
display: none;
}
#raw-response {
margin-top: 20px;
direction: rtl;
font: 12px/1.8em;
padding: 10px;
display: none;
text-align: left;
direction: ltr;
background: #272822;
height: 350px;
overflow: scroll;
color: #fff;
}
pre {
white-space: pre-wrap;
/* css-3 */
white-space: -moz-pre-wrap;
/* Mozilla, since 1999 */
white-space: -pre-wrap;
/* Opera 4-6 */
white-space: -o-pre-wrap;
/* Opera 7 */
word-wrap: break-word;
/* Internet Explorer 5.5+ */
}
.string { color: #a6e22e; }
.number { color: #ae81ff; }
.boolean { color: #f92672; }
.null { color: magenta; }
.key { color: #e6db74; }
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8/>
<title>CedarMaps - Simple Map Load</title>
<script src='../dist/v1.0.0/cedarmaps.js'></script>
<link href='../dist/v1.0.0/cedarmaps.css' rel='stylesheet'/>
<script src='../access-token.js'></script>
<style>
body {
margin: 0;
padding: 0;
}
.map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div id='map' class='map'></div>
<script>
try {
var cedarMapsMethods = CedarMaps.api(accessToken)
} catch (err) {
console.log(err)
throw new Error('You need to get an access token to be able to use cedarmaps SDK. ' +
'Send us an email to <info@cedar.ir>')
}
/**
* Initilizing Map View
*/
// initilizing map into div#map
var map = CedarMaps.map(accessToken, {
style: 'cedarmaps://styles/dark',
container: 'map',
scrollWheelZoom: true,
center: [51.378618, 35.767243],
zoom: 14
})
/**
* Initilizing Direction
*/
var direction = cedarMapsMethods.direction
// Points should be separated by a semicolon. e.g.: lat,lng;lat,lng;lat,lng....
// You can provide up to 100 stops (including start, middle and end points) for a direction request. Here we provided 3.
direction({lat: 35.764335, lon: 51.365622}, {lat: 35.7604311, lon: 51.3939486}, {}, function (err, result) {
if (err) {
return console.log(err)
}
var RouteGeometry = result.routes[0].geometry
console.log(RouteGeometry)
map.addLayer({
'id': 'route',
'type': 'line',
'source': {
'type': 'geojson',
'data': {
'type': 'Feature',
'properties': {},
'geometry': RouteGeometry
}
},
'layout': {
'line-join': 'round',
'line-cap': 'round'
},
'paint': {
'line-color': '#1cfff3',
'line-width': 5
}
})
})
</script>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="162px" height="44px" viewBox="0 0 162 44" enable-background="new 0 0 162 44" xml:space="preserve">
<g>
<ellipse opacity="0.08" enable-background="new " cx="143.858" cy="41.112" rx="18.018" ry="2.795"/>
<ellipse opacity="0.15" enable-background="new " cx="144.285" cy="40.364" rx="11.224" ry="1.662"/>
<path fill="#19B3BB" d="M160.045,11.099c0,11.761-13.69,25.58-14.27,26.16c-1.049,1.052-2.753,1.055-3.806,0.005
c-0.002-0.002-0.004-0.004-0.005-0.005c-0.583-0.58-14.27-14.399-14.27-26.16c0-14.484,32.35-14.484,32.35,0L160.045,11.099z"/>
<path fill="#FFFFFF" d="M136.977,10.912c0-1.571,0.946-3.581,2.517-3.581c1.65,0,3.349,1.984,3.349,3.607s-1.335,2.88-2.959,2.88
c-1.602,0.004-2.903-1.291-2.907-2.893C136.977,10.921,136.977,10.916,136.977,10.912z M143.755,9.94
c0-1.102,1.173-2.511,2.275-2.511c1.158,0,1.839,1.391,1.839,2.53c0,1.138-0.937,2.02-2.076,2.02
c-1.123,0.002-2.036-0.907-2.038-2.03C143.755,9.946,143.755,9.943,143.755,9.94z M145.224,23.698
c-2.555,0.937-5.713,1.05-8.757-0.913c-0.5-0.373-1.01-1.165-1.168-1.76c-0.102-0.385-0.072-1.405,0.751-1.702
c0.585-0.21,13.728-5.206,14.24-5.39c1.226-0.442,1.735,1.1,1.876,1.634C152.292,16.042,152.42,21.057,145.224,23.698
L145.224,23.698z"/>
<path opacity="0.3" fill="#0D8383" enable-background="new " d="M143.253,36.899c-0.46-0.57-12.182-14.678-12.182-26.212
c0-2.763,0.253-5.467,2.227-6.997c-3.406,1.4-4.862,4.512-4.862,8.222c0,11.097,12.936,24.118,13.396,24.666
c0.413,0.497,0.782,1.092,1.325,1.092c0.519,0,0,0,0.407-0.452C143.451,37.122,143.347,37.015,143.253,36.899L143.253,36.899z"/>
<ellipse opacity="0.15" enable-background="new " cx="143.77" cy="40.114" rx="4.77" ry="0.707"/>
<path fill="#FEFCFB" d="M15.78,34.563c0.927,0,1.781,0.779,1.781,1.78c0,1.003-0.854,1.782-1.782,1.782
c-1.04,0-1.856-0.78-1.856-1.781c0-1.002,0.817-1.781,1.856-1.781L15.78,34.563z M13.292,36.343c0,1.003-0.78,1.782-1.782,1.782
s-1.818-0.78-1.818-1.781c0-1.002,0.816-1.781,1.818-1.781C12.513,34.563,13.292,35.342,13.292,36.343z M13.589,38.385
c0.928,0,1.782,0.779,1.782,1.781s-0.854,1.781-1.782,1.781c-1.04,0-1.856-0.78-1.856-1.781
C11.733,39.164,12.55,38.385,13.589,38.385z M39.5,16.639c4.008,0,6.792,3.044,6.792,7.534c0,5.12-2.673,8.202-6.793,8.202
c-2.153,0-3.972-0.89-5.234-2.337c-1.15,1.559-2.932,2.304-5.605,2.304c-0.074,0-0.148-0.031-0.297-0.031h-1.15
c-1.522,0-2.747-0.557-3.6-1.484h-0.15c-0.779,0.927-1.892,1.484-3.377,1.484H7.39c-4.64,0-7.015-4.305-7.015-8.164
c0-4.527,2.115-6.123,4.231-6.123h1.262c0,0-2.635,1.689-2.635,5.436c0,2.005,0.854,5.697,4.194,5.697h11.841
c1.745,0,2.79-0.754,2.79-2.758v-6.705h1.033c1.67,0,2.19,0.674,2.19,2.456c0,1.261-0.036,2.232-0.036,2.974
c0,3.414,0.853,4.033,2.783,4.033h0.594c3.267,0,3.824-1.212,3.824-4.404c0-5.046,2.746-8.114,7.052-8.114L39.5,16.639z
M39.76,29.367c2.263,0,3.525-1.93,3.526-4.638c0-3.34-1.448-5.084-4.084-5.084c-2.227,0-3.674,1.744-3.674,4.601
C35.528,27.364,37.049,29.367,39.76,29.367L39.76,29.367z M54.866,19.694c1.67,0,2.272,0.619,2.272,2.4V34.08
c0,2.45-2.227,4.713-5.16,4.713c-1.522,0-2.635-0.63-2.635-1.707v-0.854c0.371,0.038,0.594,0.075,0.89,0.075
c4.195,0,3.564-2.412,3.564-7.274v-9.34L54.866,19.694L54.866,19.694z M60.769,9.86c0.779,0,1.566,0.693,1.566,1.584v20.867h-1.047
c-1.188,0-1.923-0.68-1.923-2.238V9.86C59.365,9.86,60.769,9.86,60.769,9.86z M88.348,34.563c0.928,0,1.781,0.779,1.781,1.78
c0,1.003-0.853,1.782-1.781,1.782c-1.04,0-1.856-0.78-1.856-1.781C86.492,35.342,87.308,34.563,88.348,34.563z M84.078,34.563
c1.003,0,1.783,0.779,1.783,1.78c0,1.003-0.78,1.782-1.782,1.782s-1.819-0.78-1.819-1.781
C82.26,35.342,83.077,34.563,84.078,34.563L84.078,34.563z M115.222,17.838c1.67,0,2.235,0.62,2.235,2.4v4.899
c0,4.75-2.398,7.165-5.628,7.165c-3.786,0-5.219-1.259-5.404-1.407c-0.891,0.89-2.042,1.416-3.527,1.416h-12.62
c-1.522,0-2.747-0.557-3.6-1.41c-0.891,0.853-2.08,1.41-3.601,1.41h-1.625v-0.016c-1.671-0.036-2.935-0.564-3.4-1.03
c-0.892,0.854-2.325,1.046-4.737,1.046H66.15c-0.891,0-1.59-0.866-1.59-1.645v-1.51h11.018c-0.334-5.01-3.193-9.042-7.424-9.042
c-1.225,0-1.893,0.383-1.893,0.383l0.52-0.965c0.667-1.262,1.893-1.968,3.786-1.968c0,0,1.93-0.003,3.711,1.258
c2.524,1.522,3.935,5.56,4.343,8.64c0.297,1.262,1.337,1.695,2.673,1.695h0.965c1.745,0,2.718-0.754,2.903-2.758v-6.705h0.92
c1.67,0,2.235,0.656,2.235,2.438v4.453c0,1.855,1.069,2.572,2.776,2.572h4.463V17.839h0.994c1.67,0,2.16,0.619,2.16,2.4v8.918h3.37
c1.745,0,2.755-0.754,2.755-2.758v-8.56h1.069c1.67,0,2.195,0.662,2.195,2.443c0,0,0.005,6.45,0.042,6.525
c-0.026,0.512-0.097,1.021-0.212,1.521c1.188,0.706,2.36,0.965,3.361,0.965c2.264,0,2.825-1.187,3.01-2.894v-8.56h0.92
L115.222,17.838z"/>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="260" viewBox="0 0 26 260" >
<g id="sprite" fill="#ffffff">
<path
id="zoomIn"
d="m 12.5,8.99999 c -0.277,0 -0.5,0.223 -0.5,0.5 l 0,2.50002 -2.5,0 c -0.277,0 -0.5,0.223 -0.5,0.5 l 0,1 c 0,0.277 0.223,0.5 0.5,0.5 l 2.5,0 0,2.5 c 0,0.277 0.223,0.5 0.5,0.5 l 1,0 c 0.277,0 0.5,-0.223 0.5,-0.5 l 0,-2.5 2.5,0 c 0.277,0 0.5,-0.223 0.5,-0.5 l 0,-1 c 0,-0.277 -0.223,-0.5 -0.5,-0.5 l -2.5,0 0,-2.50002 c 0,-0.277 -0.223,-0.5 -0.5,-0.5 z" />
<path
id="zoomOut"
d="M 9.5,38 C 9.223,38 9,38.223 9,38.5 l 0,1 C 9,39.777 9.223,40 9.5,40 l 7,0 c 0.277,0 0.5,-0.223 0.5,-0.5 l 0,-1 C 17,38.223 16.777,38 16.5,38 Z" />
<path
id="close"
d="m 10,61 -1,1 3,3 -3,3 1,1 3,-3 3,3 1,-1 -3,-3 3,-3 -1,-1 -3,3 z" />
<path
id="info"
d="m 13,83.99999 c -3.866,0 -7,3.134 -7,7.00002 0,3.866 3.134,7 7,7 3.8659,0 7,-3.134 7,-7 0,-3.86602 -3.1341,-7.00002 -7,-7.00002 z m -0.5,3 1,0 c 0.277,0 0.5,0.223 0.5,0.5 l 0,1 c 0,0.27702 -0.223,0.50002 -0.5,0.50002 l -1,0 c -0.277,0 -0.5,-0.223 -0.5,-0.50002 l 0,-1 c 0,-0.277 0.223,-0.5 0.5,-0.5 z m 0,3.00002 1,0 c 0.277,0 0.5,0.223 0.5,0.5 l 0,4 c 0,0.277 -0.223,0.5 -0.5,0.5 l -1,0 c -0.277,0 -0.5,-0.223 -0.5,-0.5 l 0,-4 c 0,-0.277 0.223,-0.5 0.5,-0.5 z" />
<path
id="layers"
d="m 13,110.96875 c -0.1012,-5e-4 -0.19265,0.0145 -0.28125,0.0625 L 6,113 l 0,1 6.71875,1.9375 C 12.80675,115.9855 12.8995,116 13,116 c 0.1001,0 0.19325,-0.0145 0.28125,-0.0625 L 20,114 l 0,-1 -6.71875,-1.96875 c -0.088,-0.048 -0.18155,-0.0625 -0.28125,-0.0625 z M 6,118 l 6.71875,1.9375 C 12.80675,119.9855 12.8995,120 13,120 c 0.1001,0 0.19325,-0.0145 0.28125,-0.0625 L 20,118 l 0,-2 -6.71875,1.9375 C 13.19325,117.9855 13.1001,118 13,118 c -0.1005,0 -0.19325,-0.0145 -0.28125,-0.0625 L 6,116 Z m 0,4 6.71875,1.9375 C 12.80675,123.9855 12.8995,124 13,124 c 0.1001,0 0.19325,-0.0145 0.28125,-0.0625 L 20,122 l 0,-2 -6.71875,1.9375 C 13.19325,121.9855 13.1001,122 13,122 c -0.1005,0 -0.19325,-0.0145 -0.28125,-0.0625 L 6,120 Z" />
<path
id="share"
d="m 14.3438,136.99999 2.125,2.125 -4.25,4.25002 1.4062,1.4062 4.25,-4.25002 2.125,2.12502 0,-5.65622 z m -6.3438,1 -1,1 0,9.00002 1,1 10,0 1,-1 0,-4 -1,-1 -1,1 0,3 -8,0 0,-7.00002 4,0 1,-1 -1,-1 z" />
<path
id="search"
d="m 11.5,162.99999 c -2.4853,0 -4.5,2.0147 -4.5,4.50002 0,2.4853 2.0147,4.5 4.5,4.5 0.854,0 1.6635,-0.2431 2.3437,-0.6563 l 3.6563,3.6563 1.5,-1.5 -3.6563,-3.6563 c 0.4132,-0.6802 0.6563,-1.4897 0.6563,-2.3437 0,-2.48532 -2.0147,-4.50002 -4.5,-4.50002 z m 0,1.5 c 1.6568,0 3,1.3431 3,3.00002 0,1.6568 -1.3432,3 -3,3 -1.6569,0 -3,-1.3432 -3,-3 0,-1.65692 1.3431,-3.00002 3,-3.00002 z" />
<path
id="facebook"
d="m 7,186.99998 -1,1 0,12 1,1 6.81812,1e-5 0,-5.00001 -1.8245,0 0,-2 1.8245,0 0,-2.09264 c 0,-1.80824 1.10439,-2.79288 2.7175,-2.79288 0.77272,0 1.09654,0.0575 1.29005,0.0832 l 0,1.80232 -0.77851,5.2e-4 C 16.1699,191.0005 16,191.41736 16,192.0291 l 0,1.97088 2.09228,0 -0.2724,2 -1.81988,0 0,5.00001 3,-1e-5 1,-1 0,-12 -1,-1 z" />
<path
id="twitter"
d="m 19.99957,216.12602 c -0.51509,0.22492 -1.06868,0.37693 -1.64967,0.44524 0.59299,-0.34993 1.04838,-0.90408 1.26288,-1.56444 -0.55499,0.32413 -1.16968,0.55945 -1.82397,0.68616 C 17.26502,215.14343 16.51853,214.8 15.69245,214.8 c -1.58627,0 -2.87235,1.26611 -2.87235,2.82775 0,0.22164 0.025,0.43756 0.075,0.64448 -2.38705,-0.11791 -4.50341,-1.24373 -5.91999,-2.95458 -0.24719,0.41763 -0.38889,0.90338 -0.38889,1.42162 0,0.98111 0.50699,1.84658 1.27768,2.35373 -0.4708,-0.015 -0.91369,-0.14191 -1.30088,-0.35363 -3e-4,0.012 -3e-4,0.024 -3e-4,0.035 0,1.37002 0.99008,2.51291 2.30396,2.77274 -0.241,0.065 -0.49469,0.099 -0.75669,0.099 -0.1851,0 -0.36499,-0.018 -0.54029,-0.051 0.36539,1.1234 1.42607,1.94097 2.68295,1.96377 -0.98298,0.75847 -2.22136,1.21061 -3.56713,1.21061 -0.2318,0 -0.46039,-0.013 -0.68509,-0.04 C 7.27151,225.53176 8.78128,226 10.40325,226 c 5.2831,0 8.17205,-4.30888 8.17205,-8.0457 0,-0.12261 0,-0.24462 -0.01,-0.36585 0.56129,-0.39874 1.04818,-0.89668 1.43327,-1.46383" />
<path
id="pinterest"
d="M 13.50024,238.9996 C 9.35822,238.9996 6,242.35751 6,246.49969 c 0,3.07113 1.84674,5.70949 4.48939,6.86948 -0.0211,-0.5237 -0.004,-1.15239 0.13052,-1.7222 0.14421,-0.60892 0.96507,-4.08682 0.96507,-4.08682 0,0 -0.23961,-0.47889 -0.23961,-1.18669 0,-1.11141 0.64421,-1.94155 1.44648,-1.94155 0.68215,0 1.01169,0.51241 1.01169,1.12601 0,0.68581 -0.43735,1.71156 -0.66231,2.66165 -0.18789,0.79559 0.39892,1.44451 1.1838,1.44451 1.42105,0 2.37808,-1.82512 2.37808,-3.98753 0,-1.64383 -1.10715,-2.87415 -3.12081,-2.87415 -2.27506,0 -3.69243,1.69664 -3.69243,3.59178 0,0.6534 0.19268,1.11426 0.49445,1.47102 0.13874,0.1639 0.15803,0.22983 0.10778,0.418 -0.0359,0.13804 -0.11858,0.47026 -0.15277,0.60191 -0.05,0.18998 -0.20384,0.25786 -0.37553,0.18774 -1.04789,-0.4278 -1.53596,-1.5754 -1.53596,-2.86536 0,-2.13055 1.79685,-4.68521 5.36034,-4.68521 2.86349,0 4.74808,2.0721 4.74808,4.29635 0,2.94222 -1.63569,5.14028 -4.04684,5.14028 -0.8097,0 -1.57134,-0.43774 -1.83228,-0.9349 0,0 -0.43543,1.72808 -0.52766,2.06171 -0.15897,0.57829 -0.47026,1.1562 -0.75486,1.60673 0.67461,0.19909 1.3871,0.30755 2.12562,0.30755 4.1417,0 7.49977,-3.35795 7.49977,-7.50031 0,-4.14218 -3.35807,-7.50009 -7.49977,-7.50009" />
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="260" viewBox="0 0 26 260" >
<g id="sprite" fill="#000000">
<path
id="zoomIn"
d="m 12.5,8.99999 c -0.277,0 -0.5,0.223 -0.5,0.5 l 0,2.50002 -2.5,0 c -0.277,0 -0.5,0.223 -0.5,0.5 l 0,1 c 0,0.277 0.223,0.5 0.5,0.5 l 2.5,0 0,2.5 c 0,0.277 0.223,0.5 0.5,0.5 l 1,0 c 0.277,0 0.5,-0.223 0.5,-0.5 l 0,-2.5 2.5,0 c 0.277,0 0.5,-0.223 0.5,-0.5 l 0,-1 c 0,-0.277 -0.223,-0.5 -0.5,-0.5 l -2.5,0 0,-2.50002 c 0,-0.277 -0.223,-0.5 -0.5,-0.5 z" />
<path
id="zoomOut"
d="M 9.5,38 C 9.223,38 9,38.223 9,38.5 l 0,1 C 9,39.777 9.223,40 9.5,40 l 7,0 c 0.277,0 0.5,-0.223 0.5,-0.5 l 0,-1 C 17,38.223 16.777,38 16.5,38 Z" />
<path
id="close"
d="m 10,61 -1,1 3,3 -3,3 1,1 3,-3 3,3 1,-1 -3,-3 3,-3 -1,-1 -3,3 z" />
<path
id="info"
d="m 13,83.99999 c -3.866,0 -7,3.134 -7,7.00002 0,3.866 3.134,7 7,7 3.8659,0 7,-3.134 7,-7 0,-3.86602 -3.1341,-7.00002 -7,-7.00002 z m -0.5,3 1,0 c 0.277,0 0.5,0.223 0.5,0.5 l 0,1 c 0,0.27702 -0.223,0.50002 -0.5,0.50002 l -1,0 c -0.277,0 -0.5,-0.223 -0.5,-0.50002 l 0,-1 c 0,-0.277 0.223,-0.5 0.5,-0.5 z m 0,3.00002 1,0 c 0.277,0 0.5,0.223 0.5,0.5 l 0,4 c 0,0.277 -0.223,0.5 -0.5,0.5 l -1,0 c -0.277,0 -0.5,-0.223 -0.5,-0.5 l 0,-4 c 0,-0.277 0.223,-0.5 0.5,-0.5 z" />
<path
id="layers"
d="m 13,110.96875 c -0.1012,-5e-4 -0.19265,0.0145 -0.28125,0.0625 L 6,113 l 0,1 6.71875,1.9375 C 12.80675,115.9855 12.8995,116 13,116 c 0.1001,0 0.19325,-0.0145 0.28125,-0.0625 L 20,114 l 0,-1 -6.71875,-1.96875 c -0.088,-0.048 -0.18155,-0.0625 -0.28125,-0.0625 z M 6,118 l 6.71875,1.9375 C 12.80675,119.9855 12.8995,120 13,120 c 0.1001,0 0.19325,-0.0145 0.28125,-0.0625 L 20,118 l 0,-2 -6.71875,1.9375 C 13.19325,117.9855 13.1001,118 13,118 c -0.1005,0 -0.19325,-0.0145 -0.28125,-0.0625 L 6,116 Z m 0,4 6.71875,1.9375 C 12.80675,123.9855 12.8995,124 13,124 c 0.1001,0 0.19325,-0.0145 0.28125,-0.0625 L 20,122 l 0,-2 -6.71875,1.9375 C 13.19325,121.9855 13.1001,122 13,122 c -0.1005,0 -0.19325,-0.0145 -0.28125,-0.0625 L 6,120 Z" />
<path
id="share"
d="m 14.3438,136.99999 2.125,2.125 -4.25,4.25002 1.4062,1.4062 4.25,-4.25002 2.125,2.12502 0,-5.65622 z m -6.3438,1 -1,1 0,9.00002 1,1 10,0 1,-1 0,-4 -1,-1 -1,1 0,3 -8,0 0,-7.00002 4,0 1,-1 -1,-1 z" />
<path
id="search"
d="m 11.5,162.99999 c -2.4853,0 -4.5,2.0147 -4.5,4.50002 0,2.4853 2.0147,4.5 4.5,4.5 0.854,0 1.6635,-0.2431 2.3437,-0.6563 l 3.6563,3.6563 1.5,-1.5 -3.6563,-3.6563 c 0.4132,-0.6802 0.6563,-1.4897 0.6563,-2.3437 0,-2.48532 -2.0147,-4.50002 -4.5,-4.50002 z m 0,1.5 c 1.6568,0 3,1.3431 3,3.00002 0,1.6568 -1.3432,3 -3,3 -1.6569,0 -3,-1.3432 -3,-3 0,-1.65692 1.3431,-3.00002 3,-3.00002 z" />
<path
id="facebook"
d="m 7,186.99998 -1,1 0,12 1,1 6.81812,1e-5 0,-5.00001 -1.8245,0 0,-2 1.8245,0 0,-2.09264 c 0,-1.80824 1.10439,-2.79288 2.7175,-2.79288 0.77272,0 1.09654,0.0575 1.29005,0.0832 l 0,1.80232 -0.77851,5.2e-4 C 16.1699,191.0005 16,191.41736 16,192.0291 l 0,1.97088 2.09228,0 -0.2724,2 -1.81988,0 0,5.00001 3,-1e-5 1,-1 0,-12 -1,-1 z" />
<path
id="twitter"
d="m 19.99957,216.12602 c -0.51509,0.22492 -1.06868,0.37693 -1.64967,0.44524 0.59299,-0.34993 1.04838,-0.90408 1.26288,-1.56444 -0.55499,0.32413 -1.16968,0.55945 -1.82397,0.68616 C 17.26502,215.14343 16.51853,214.8 15.69245,214.8 c -1.58627,0 -2.87235,1.26611 -2.87235,2.82775 0,0.22164 0.025,0.43756 0.075,0.64448 -2.38705,-0.11791 -4.50341,-1.24373 -5.91999,-2.95458 -0.24719,0.41763 -0.38889,0.90338 -0.38889,1.42162 0,0.98111 0.50699,1.84658 1.27768,2.35373 -0.4708,-0.015 -0.91369,-0.14191 -1.30088,-0.35363 -3e-4,0.012 -3e-4,0.024 -3e-4,0.035 0,1.37002 0.99008,2.51291 2.30396,2.77274 -0.241,0.065 -0.49469,0.099 -0.75669,0.099 -0.1851,0 -0.36499,-0.018 -0.54029,-0.051 0.36539,1.1234 1.42607,1.94097 2.68295,1.96377 -0.98298,0.75847 -2.22136,1.21061 -3.56713,1.21061 -0.2318,0 -0.46039,-0.013 -0.68509,-0.04 C 7.27151,225.53176 8.78128,226 10.40325,226 c 5.2831,0 8.17205,-4.30888 8.17205,-8.0457 0,-0.12261 0,-0.24462 -0.01,-0.36585 0.56129,-0.39874 1.04818,-0.89668 1.43327,-1.46383" />
<path
id="pinterest"
d="M 13.50024,238.9996 C 9.35822,238.9996 6,242.35751 6,246.49969 c 0,3.07113 1.84674,5.70949 4.48939,6.86948 -0.0211,-0.5237 -0.004,-1.15239 0.13052,-1.7222 0.14421,-0.60892 0.96507,-4.08682 0.96507,-4.08682 0,0 -0.23961,-0.47889 -0.23961,-1.18669 0,-1.11141 0.64421,-1.94155 1.44648,-1.94155 0.68215,0 1.01169,0.51241 1.01169,1.12601 0,0.68581 -0.43735,1.71156 -0.66231,2.66165 -0.18789,0.79559 0.39892,1.44451 1.1838,1.44451 1.42105,0 2.37808,-1.82512 2.37808,-3.98753 0,-1.64383 -1.10715,-2.87415 -3.12081,-2.87415 -2.27506,0 -3.69243,1.69664 -3.69243,3.59178 0,0.6534 0.19268,1.11426 0.49445,1.47102 0.13874,0.1639 0.15803,0.22983 0.10778,0.418 -0.0359,0.13804 -0.11858,0.47026 -0.15277,0.60191 -0.05,0.18998 -0.20384,0.25786 -0.37553,0.18774 -1.04789,-0.4278 -1.53596,-1.5754 -1.53596,-2.86536 0,-2.13055 1.79685,-4.68521 5.36034,-4.68521 2.86349,0 4.74808,2.0721 4.74808,4.29635 0,2.94222 -1.63569,5.14028 -4.04684,5.14028 -0.8097,0 -1.57134,-0.43774 -1.83228,-0.9349 0,0 -0.43543,1.72808 -0.52766,2.06171 -0.15897,0.57829 -0.47026,1.1562 -0.75486,1.60673 0.67461,0.19909 1.3871,0.30755 2.12562,0.30755 4.1417,0 7.49977,-3.35795 7.49977,-7.50031 0,-4.14218 -3.35807,-7.50009 -7.49977,-7.50009" />
</g>
</svg>
/*! Version: 0.62.0
Copyright (c) 2016 Dominik Moritz */
!function(t,i){"function"==typeof define&&define.amd?define(["leaflet"],t):"object"==typeof exports&&(void 0!==i&&i.L?module.exports=t(L):module.exports=t(require("leaflet"))),void 0!==i&&i.L&&(i.L.Control.Locate=t(L))}(function(t){var i=function(i,o,s){(s=s.split(" ")).forEach(function(s){t.DomUtil[i].call(this,o,s)})},o=function(t,o){i("addClass",t,o)},s=function(t,o){i("removeClass",t,o)},e=t.Control.extend({options:{position:"topleft",layer:void 0,setView:"untilPan",keepCurrentZoomLevel:!1,flyTo:!1,clickBehavior:{inView:"stop",outOfView:"setView"},returnToPrevBounds:!1,cacheLocation:!0,drawCircle:!0,drawMarker:!0,markerClass:t.CircleMarker,circleStyle:{color:"#136AEC",fillColor:"#136AEC",fillOpacity:.15,weight:2,opacity:.5},markerStyle:{color:"#136AEC",fillColor:"#2A93EE",fillOpacity:.7,weight:2,opacity:.9,radius:5},followCircleStyle:{},followMarkerStyle:{},icon:"fa fa-map-marker",iconLoading:"fa fa-spinner fa-spin",iconElementTag:"span",circlePadding:[0,0],metric:!0,createButtonCallback:function(i,o){var s=t.DomUtil.create("a","leaflet-bar-part leaflet-bar-part-single",i);return s.title=o.strings.title,{link:s,icon:t.DomUtil.create(o.iconElementTag,o.icon,s)}},onLocationError:function(t,i){alert(t.message)},onLocationOutsideMapBounds:function(t){t.stop(),alert(t.options.strings.outsideMapBoundsMsg)},showPopup:!0,strings:{title:"Show me where I am",metersUnit:"meters",feetUnit:"feet",popup:"You are within {distance} {unit} from this point",outsideMapBoundsMsg:"You seem located outside the boundaries of the map"},locateOptions:{maxZoom:1/0,watch:!0,setView:!1}},initialize:function(i){for(var o in i)"object"==typeof this.options[o]?t.extend(this.options[o],i[o]):this.options[o]=i[o];this.options.followMarkerStyle=t.extend({},this.options.markerStyle,this.options.followMarkerStyle),this.options.followCircleStyle=t.extend({},this.options.circleStyle,this.options.followCircleStyle)},onAdd:function(i){var o=t.DomUtil.create("div","leaflet-control-locate leaflet-bar leaflet-control");this._layer=this.options.layer||new t.LayerGroup,this._layer.addTo(i),this._event=void 0,this._prevBounds=null;var s=this.options.createButtonCallback(o,this.options);return this._link=s.link,this._icon=s.icon,t.DomEvent.on(this._link,"click",t.DomEvent.stopPropagation).on(this._link,"click",t.DomEvent.preventDefault).on(this._link,"click",this._onClick,this).on(this._link,"dblclick",t.DomEvent.stopPropagation),this._resetVariables(),this._map.on("unload",this._unload,this),o},_onClick:function(){if(this._justClicked=!0,this._userPanned=!1,this._active&&!this._event)this.stop();else if(this._active&&void 0!==this._event)switch(this._map.getBounds().contains(this._event.latlng)?this.options.clickBehavior.inView:this.options.clickBehavior.outOfView){case"setView":this.setView();break;case"stop":this.stop(),this.options.returnToPrevBounds&&(this.options.flyTo?this._map.flyToBounds:this._map.fitBounds).bind(this._map)(this._prevBounds)}else this.options.returnToPrevBounds&&(this._prevBounds=this._map.getBounds()),this.start();this._updateContainerStyle()},start:function(){this._activate(),this._event&&(this._drawMarker(this._map),this.options.setView&&this.setView()),this._updateContainerStyle()},stop:function(){this._deactivate(),this._cleanClasses(),this._resetVariables(),this._removeMarker()},_activate:function(){this._active||(this._map.locate(this.options.locateOptions),this._active=!0,this._map.on("locationfound",this._onLocationFound,this),this._map.on("locationerror",this._onLocationError,this),this._map.on("dragstart",this._onDrag,this))},_deactivate:function(){this._map.stopLocate(),this._active=!1,this.options.cacheLocation||(this._event=void 0),this._map.off("locationfound",this._onLocationFound,this),this._map.off("locationerror",this._onLocationError,this),this._map.off("dragstart",this._onDrag,this)},setView:function(){if(this._drawMarker(),this._isOutsideMapBounds())this._event=void 0,this.options.onLocationOutsideMapBounds(this);else if(this.options.keepCurrentZoomLevel)(t=this.options.flyTo?this._map.flyTo:this._map.panTo).bind(this._map)([this._event.latitude,this._event.longitude]);else{var t=this.options.flyTo?this._map.flyToBounds:this._map.fitBounds;t.bind(this._map)(this._event.bounds,{padding:this.options.circlePadding,maxZoom:this.options.locateOptions.maxZoom})}},_drawMarker:function(){void 0===this._event.accuracy&&(this._event.accuracy=0);var i=this._event.accuracy,o=this._event.latlng;if(this.options.drawCircle){var s=this._isFollowing()?this.options.followCircleStyle:this.options.circleStyle;this._circle?this._circle.setLatLng(o).setRadius(i).setStyle(s):this._circle=t.circle(o,i,s).addTo(this._layer)}var e,n;if(this.options.metric?(e=i.toFixed(0),n=this.options.strings.metersUnit):(e=(3.2808399*i).toFixed(0),n=this.options.strings.feetUnit),this.options.drawMarker){var a=this._isFollowing()?this.options.followMarkerStyle:this.options.markerStyle;this._marker?(this._marker.setLatLng(o),this._marker.setStyle&&this._marker.setStyle(a)):this._marker=new this.options.markerClass(o,a).addTo(this._layer)}var r=this.options.strings.popup;this.options.showPopup&&r&&this._marker&&this._marker.bindPopup(t.Util.template(r,{distance:e,unit:n}))._popup.setLatLng(o)},_removeMarker:function(){this._layer.clearLayers(),this._marker=void 0,this._circle=void 0},_unload:function(){this.stop(),this._map.off("unload",this._unload,this)},_onLocationError:function(t){3==t.code&&this.options.locateOptions.watch||(this.stop(),this.options.onLocationError(t,this))},_onLocationFound:function(t){if((!this._event||this._event.latlng.lat!==t.latlng.lat||this._event.latlng.lng!==t.latlng.lng||this._event.accuracy!==t.accuracy)&&this._active){switch(this._event=t,this._drawMarker(),this._updateContainerStyle(),this.options.setView){case"once":this._justClicked&&this.setView();break;case"untilPan":this._userPanned||this.setView();break;case"always":this.setView()}this._justClicked=!1}},_onDrag:function(){this._event&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_isFollowing:function(){return!!this._active&&("always"===this.options.setView||("untilPan"===this.options.setView?!this._userPanned:void 0))},_isOutsideMapBounds:function(){return void 0!==this._event&&(this._map.options.maxBounds&&!this._map.options.maxBounds.contains(this._event.latlng))},_updateContainerStyle:function(){this._container&&(this._active&&!this._event?this._setClasses("requesting"):this._isFollowing()?this._setClasses("following"):this._active?this._setClasses("active"):this._cleanClasses())},_setClasses:function(t){"requesting"==t?(s(this._container,"active following"),o(this._container,"requesting"),s(this._icon,this.options.icon),o(this._icon,this.options.iconLoading)):"active"==t?(s(this._container,"requesting following"),o(this._container,"active"),s(this._icon,this.options.iconLoading),o(this._icon,this.options.icon)):"following"==t&&(s(this._container,"requesting"),o(this._container,"active following"),s(this._icon,this.options.iconLoading),o(this._icon,this.options.icon))},_cleanClasses:function(){t.DomUtil.removeClass(this._container,"requesting"),t.DomUtil.removeClass(this._container,"active"),t.DomUtil.removeClass(this._container,"following"),s(this._icon,this.options.iconLoading),o(this._icon,this.options.icon)},_resetVariables:function(){this._active=!1,this._justClicked=!1,this._userPanned=!1}});return t.control.locate=function(i){return new t.Control.Locate(i)},e},window);
//# sourceMappingURL=L.Control.Locate.min.js.map
\ No newline at end of file
This diff is collapsed.
// JavaScript autoComplete v1.0.4
// https://github.com/Pixabay/JavaScript-autoComplete
var autoComplete=function(){function e(e){function t(e,t){return e.classList?e.classList.contains(t):new RegExp("\\b"+t+"\\b").test(e.className)}function o(e,t,o){e.attachEvent?e.attachEvent("on"+t,o):e.addEventListener(t,o)}function s(e,t,o){e.detachEvent?e.detachEvent("on"+t,o):e.removeEventListener(t,o)}function n(e,s,n,l){o(l||document,s,function(o){for(var s,l=o.target||o.srcElement;l&&!(s=t(l,e));)l=l.parentElement;s&&n.call(l,o)})}if(document.querySelector){var l={selector:0,source:0,minChars:3,delay:150,offsetLeft:0,offsetTop:1,cache:1,menuClass:"",renderItem:function(e,t){t=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");var o=new RegExp("("+t.split(" ").join("|")+")","gi");return'<div class="autocomplete-suggestion" data-val="'+e+'">'+e.replace(o,"<b>$1</b>")+"</div>"},onSelect:function(){}};for(var c in e)e.hasOwnProperty(c)&&(l[c]=e[c]);for(var a="object"==typeof l.selector?[l.selector]:document.querySelectorAll(l.selector),u=0;u<a.length;u++){var i=a[u];i.sc=document.createElement("div"),i.sc.className="autocomplete-suggestions "+l.menuClass,i.autocompleteAttr=i.getAttribute("autocomplete"),i.setAttribute("autocomplete","off"),i.cache={},i.last_val="",i.updateSC=function(e,t){var o=i.getBoundingClientRect();if(i.sc.style.left=Math.round(o.left+(window.pageXOffset||document.documentElement.scrollLeft)+l.offsetLeft)+"px",i.sc.style.top=Math.round(o.bottom+(window.pageYOffset||document.documentElement.scrollTop)+l.offsetTop)+"px",i.sc.style.width=Math.round(o.right-o.left)+"px",!e&&(i.sc.style.display="block",i.sc.maxHeight||(i.sc.maxHeight=parseInt((window.getComputedStyle?getComputedStyle(i.sc,null):i.sc.currentStyle).maxHeight)),i.sc.suggestionHeight||(i.sc.suggestionHeight=i.sc.querySelector(".autocomplete-suggestion").offsetHeight),i.sc.suggestionHeight))if(t){var s=i.sc.scrollTop,n=t.getBoundingClientRect().top-i.sc.getBoundingClientRect().top;n+i.sc.suggestionHeight-i.sc.maxHeight>0?i.sc.scrollTop=n+i.sc.suggestionHeight+s-i.sc.maxHeight:0>n&&(i.sc.scrollTop=n+s)}else i.sc.scrollTop=0},o(window,"resize",i.updateSC),document.body.appendChild(i.sc),n("autocomplete-suggestion","mouseleave",function(){var e=i.sc.querySelector(".autocomplete-suggestion.selected");e&&setTimeout(function(){e.className=e.className.replace("selected","")},20)},i.sc),n("autocomplete-suggestion","mouseover",function(){var e=i.sc.querySelector(".autocomplete-suggestion.selected");e&&(e.className=e.className.replace("selected","")),this.className+=" selected"},i.sc),n("autocomplete-suggestion","mousedown",function(e){if(t(this,"autocomplete-suggestion")){var o=this.getAttribute("data-val");i.value=o,l.onSelect(e,o,this),i.sc.style.display="none"}},i.sc),i.blurHandler=function(){try{var e=document.querySelector(".autocomplete-suggestions:hover")}catch(t){var e=0}e?i!==document.activeElement&&setTimeout(function(){i.focus()},20):(i.last_val=i.value,i.sc.style.display="none",setTimeout(function(){i.sc.style.display="none"},350))},o(i,"blur",i.blurHandler);var r=function(e){var t=i.value;if(i.cache[t]=e,e.length&&t.length>=l.minChars){for(var o="",s=0;s<e.length;s++)o+=l.renderItem(e[s],t);i.sc.innerHTML=o,i.updateSC(0)}else i.sc.style.display="none"};i.keydownHandler=function(e){var t=window.event?e.keyCode:e.which;if((40==t||38==t)&&i.sc.innerHTML){var o,s=i.sc.querySelector(".autocomplete-suggestion.selected");return s?(o=40==t?s.nextSibling:s.previousSibling,o?(s.className=s.className.replace("selected",""),o.className+=" selected",i.value=o.getAttribute("data-val")):(s.className=s.className.replace("selected",""),i.value=i.last_val,o=0)):(o=40==t?i.sc.querySelector(".autocomplete-suggestion"):i.sc.childNodes[i.sc.childNodes.length-1],o.className+=" selected",i.value=o.getAttribute("data-val")),i.updateSC(0,o),!1}if(27==t)i.value=i.last_val,i.sc.style.display="none";else if(13==t||9==t){var s=i.sc.querySelector(".autocomplete-suggestion.selected");s&&"none"!=i.sc.style.display&&(l.onSelect(e,s.getAttribute("data-val"),s),setTimeout(function(){i.sc.style.display="none"},20))}},o(i,"keydown",i.keydownHandler),i.keyupHandler=function(e){var t=window.event?e.keyCode:e.which;if(!t||(35>t||t>40)&&13!=t&&27!=t){var o=i.value;if(o.length>=l.minChars){if(o!=i.last_val){if(i.last_val=o,clearTimeout(i.timer),l.cache){if(o in i.cache)return void r(i.cache[o]);for(var s=1;s<o.length-l.minChars;s++){var n=o.slice(0,o.length-s);if(n in i.cache&&!i.cache[n].length)return void r([])}}i.timer=setTimeout(function(){l.source(o,r)},l.delay)}}else i.last_val=o,i.sc.style.display="none"}},o(i,"keyup",i.keyupHandler),i.focusHandler=function(e){i.last_val="\n",i.keyupHandler(e)},l.minChars||o(i,"focus",i.focusHandler)}this.destroy=function(){for(var e=0;e<a.length;e++){var t=a[e];s(window,"resize",t.updateSC),s(t,"blur",t.blurHandler),s(t,"focus",t.focusHandler),s(t,"keydown",t.keydownHandler),s(t,"keyup",t.keyupHandler),t.autocompleteAttr?t.setAttribute("autocomplete",t.autocompleteAttr):t.removeAttribute("autocomplete"),document.body.removeChild(t.sc),t=null}}}}return e}();!function(){"function"==typeof define&&define.amd?define("autoComplete",function(){return autoComplete}):"undefined"!=typeof module&&module.exports?module.exports=autoComplete:window.autoComplete=autoComplete}();
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8/>
<title>CedarMaps - Basic Map Load with a Marker</title>
<script src='../dist/v1.0.0/cedarmaps.js'></script>
<link href='../dist/v1.0.0/cedarmaps.css' rel='stylesheet'/>
<link href='./css/reverse-geocoder.css' rel='stylesheet'/>
<script src='../access-token.js'></script>
<style>
body {
margin: 0;
padding: 0;
}
.map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div id='map' class='map'></div>
<div id="results">
<h2 style="text-align: center;">Click somewhere on the map!</h2>
<div id="loading"><img src="./img/loading-14-blue.gif" width="14" height="14"> Loading...</div>
<div id="latlng"></div>
<div id="parsed-response"></div>
<div id="raw-response"></div>
</div>
<script>
try {
var cedarMapsApi = CedarMaps.api(accessToken)
}
catch (err) {
throw new Error('You need to get an access token to be able to use cedarmaps SDK. ' +
'Send us an email to <info@cedar.ir>')
}
// initilizing map into div#map
var map = CedarMaps.map(accessToken, {
style: 'cedarmaps://styles/light',
container: 'map',
center: [51.3789253, 35.709987],
zoom: 15,
scrollWheelZoom: true,
zoomControl: false,
minZoom: 7,
maxZoom: 17,
})
var marker
var syntaxHighlight
// Setting up our DOM elements.
var resultsContainer = document.getElementById('results'),
latLngContainer = document.getElementById('latlng'),
parsedResponseContainer = document.getElementById('parsed-response'),
rawResponseContainer = document.getElementById('raw-response'),
loadingIndicator = document.getElementById('loading')
map.on('click', function (e) {
if (marker) marker.remove()
var clickedLat = e.lngLat.lat
var clickedLng = e.lngLat.lng
marker = new CedarMaps.gl.Marker().setLngLat(e.lngLat).addTo(map)
loading.style.visibility = 'visible'
latLngContainer.innerHTML = 'LatLng: ' + clickedLat + ', ' + clickedLng
cedarMapsApi.reverseGeocoding(clickedLat, clickedLng, cedarMapsApi.Constants.INDEXES.STREET_INDEX, function (err, result) {
if (err) {
return console.log(err)
}
loading.style.visibility = 'hidden'
parsedResponseContainer.style.display = 'block'
rawResponseContainer.style.display = 'block'
var parsedResponse = '<ul>' +
'<li><strong>استان:</strong> ' + result.province + '</li>' +
'<li><strong>شهر:</strong> ' + result.city + '</li>' +
'<li><strong>محله:</strong> ' + result.locality + '</li>' +
'<li><strong>خیابان:</strong> ' + result.address + '</li>' +
'<li><strong>در منطقه طرح ترافیک:</strong> ' + (result.traffic_zone.in_central ? 'بله' : 'خیر') + '</li>' +
'<li><strong>در منطقه زوج و فرد:</strong> ' + (result.traffic_zone.in_evenodd ? 'بله' : 'خیر') + '</li>' +
'</ul>'
var rawResponse = '<pre class="language-javascript">' + syntaxHighlight(JSON.stringify(result, undefined, 2)) + '</pre>'
parsedResponseContainer.innerHTML = parsedResponse
rawResponseContainer.innerHTML = rawResponse
})
})
syntaxHighlight = function (json) {
json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
var cls = 'number'
if (/^"/.test(match)) {
if (/:$/.test(match)) {
cls = 'key'
} else {
cls = 'string'
}
} else if (/true|false/.test(match)) {
cls = 'boolean'
} else if (/null/.test(match)) {
cls = 'null'
}
return '<span class="' + cls + '">' + match + '</span>'
})
}
</script>
</body>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"author": "CedarStudios",
"name": "cedarmaps.js",
"description": "CedarMaps javascript API built on top of mapbox.js",
"version": "1.0.0",
"homepage": "http://www.cedarmaps.com/",
"repository": {
"type": "git",
"url": "http://gitlab.kikojas.com/cedar.studios/cedarmaps-sdk-web.git"
},
"main": "src/index.js",
"dependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"cedar-maps": "^1.1.0",
"mapbox-gl": "^0.47.0"
},
"optionalDependencies": {},
"engines": {
"node": "*"
},
"devDependencies": {
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^1.0.0",
"webpack": "^4.16.3",
"webpack-cli": "^3.1.0"
}
}
This diff is collapsed.
'use strict'
const mapboxGl = require('mapbox-gl')
const cedarMapsMethods = require('cedar-maps')
const styleMapper = {
'cedarmaps://styles/light': 'https://api.cedarmaps.com/v1/styles/cedarmaps.light.json',
'cedarmaps://styles/dark': 'https://api.cedarmaps.com/v1/styles/cedarmaps.dark.json'
}
const map = (accessToken, options) => {
const {style} = options
const cedarMapsStyle = styleMapper[style]
if (!style) throw Error('Invalid style provided')
mapboxGl.accessToken = ''
mapboxGl.setRTLTextPlugin('https://api.cedarmaps.com/cedarmaps-gl.js/rtl-plugin.js');
return new mapboxGl.Map({...options, style: `${cedarMapsStyle}?access_token=${accessToken}`})
}
module.exports = {
map,
gl: mapboxGl,
api: cedarMapsMethods
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
entry: './src/index.js',
output: {
filename: 'cedarmaps.js',
library: 'CedarMaps',
libraryTarget: 'umd',
umdNamedDefine: true,
path: path.resolve(__dirname, 'dist', `v${require('./package.json').version}`)
},
node: {
fs: 'empty',
net: 'empty',
tls: 'empty',
global: true,
crypto: 'empty',
process: true,
module: false,
clearImmediate: false,
setImmediate: false
},
plugins: [
new CopyWebpackPlugin([
{
from: './src/js/rtl-plugin.js',
to: path.resolve(__dirname, 'dist', 'rtl-plugin.js')
},
{
from: './src/css/cedarmaps.css',
to: path.resolve(__dirname, 'dist',`v${require('./package.json').version}`, 'cedarmaps.css')
}
])
],
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'stage-2']
}
}
]
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment