geo-targeting-component
v0.1.6
Published
Geo targeting component
Downloads
18
Readme
Geo targeting component for angular 1.6.x
Example:
You can see example in ./docs/ (https://ivagafonov.github.io/geoTargetingComponent/)
Setup:
Install with npm
npm install geo-targeting-component --save
Install with bower
bower install geo-targeting-component --save
Usage:
- Add require module:
angular.module('app', ['geoTargetingModule'])
- Add html component and resolve 'model' dependency
<geo-targeting-component model="$ctrl.model" options="$ctrl.options"></geo-targeting-component>
- Create geo targeting model in parent controller
var vm = this;
vm.model = {}
vm.options = {
coordinates: [
37.64,
55.76
],
address: 'Волгоград триумфальная 13',
object: {
geometry: {
type: 'Circle',
radius: 7
},
properties: {
hintContent: "Подвинь меня"
}
},
onInit: function () {
console.log('init');
}
};
Time targeting model
- coordinates - [lat, lon] float coordinates of circle
- address - calculated address
- radius - radius (int [km])
Time targeting options:
- coordinates - [lat, lon] float coordinates of circle (low init priority);
- address - address (high init priority)
- object.geometry.type - 'Circle'
- object.geometry.radius - radius (int [km])
- object.properties.hintContent - title of object
- onInit: callback call when component init