Commit 124b7303 authored by Milad Karbasizadeh's avatar Milad Karbasizadeh

Initial commit

parents
access-token.js
# Created by https://www.gitignore.io/api/macos,windows,visualstudiocode,node
### macOS ###
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
### Node ###
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules
jspm_packages
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# End of https://www.gitignore.io/api/macos,windows,visualstudiocode,node
\ No newline at end of file
# Kikojas POI locator
## Basics
This library allows third party websites to use Cedar maps and kikojas specific categories of POIs on their pages. The basic idea is you give the location you want to explore and we fetch data from kikojas and display them on Cedar Maps.
## How to use
You don't need any third party library in order to use kikojas POI locator. The dist file includes all of the dependencies. As you can see in the example, you need to provide an access token. *Please see example/access-token.sample.js*
Sample code:
```javascript
Kikojas.nearby(lat, lng, {
accessToken: '<Your access token here>',
mapContainer: 'poi-locator',
categories: ['bus', 'park', 'shopping', 'hospital', 'school'],
poiLimit: 5,
popupContent: '<em>HTML</em> is possible here.',
seachDistance: 2,
callback: function(map, mainMarker, pois){}
});
```
### Parameters explained:
*accessToken*: The access token for Cedar Maps service.
*mapContainer*: The id of html element to put the map into.
*categories*: The list of catogories to load. Possible values are:
1. park
2. bus
3. shopping
4. hospital
5. school
*poiLimit*: Max number of POIs fetched for each category.
*mainMarkerPopupContent*: The popup content of the main marker.
*seachDistance*: The search radius.
*defaultZoom*: Default zoom for map.
*callback**: function to call after initialization is completed. Passed parameters are: map, main marker object, and POIs array.
\ No newline at end of file
var accessToken = 'this is a sample access token for cedar maps service';
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Kikojas POI Locator Widget Sample</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<link rel="stylesheet" href="https://tools.kikojas.com/kikojas.widgets.poi-locator1.0.0.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container-fluid">
<div class="row">
<div id="poi-locator" class="col-sm-6 col-sm-offset-3" style="height: 500px;">
</div>
</div>
</div>
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>-->
<script src="https://tools.kikojas.com/kikojas.widgets.poi-locator.1.0.0.uncompressed.js"></script>
<script src='access-token.js'></script>
<script>
Kikojas.nearby(35.737334, 51.355215, {
accessToken: accessToken,
mapContainer: 'poi-locator',
categories: ['bus', 'park', 'shopping', 'hospital', 'school'],
searchDistance: 5,
popupContent: '<em>مشخصات منزل</em>',
defaultZoom: 20
});
</script>
</body>
</html>
\ 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