geo-targeting-component

Geo targeting component

Usage no npm install needed!

<script type="module">
  import geoTargetingComponent from 'https://cdn.skypack.dev/geo-targeting-component';
</script>

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:

  1. Add require module:
angular.module('app', ['geoTargetingModule'])
  1. Add html component and resolve 'model' dependency
<geo-targeting-component model="$ctrl.model" options="$ctrl.options"></geo-targeting-component>
  1. 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