Skip to content

Latest commit

 

History

History
53 lines (46 loc) · 1.4 KB

README.md

File metadata and controls

53 lines (46 loc) · 1.4 KB

app-business

app-business is part of imaginary phone-device custom element. It doesn't have visual, just obtaines location and sends location data to server making ajax operations.

app-business includes

  • core-ajax
  • geo-location

sends data to server

  • specified period
  • or, when as soon as geo-location obtaines
<!-- specified period -->
<!-- geo-location updates lat&lng, app-business sends every 5000 seconds -->
<app-business url="http://localhost:3000/tracking" period="5000"> </app-business>

<!-- or, as soon as geo-location obtaines-->
<!-- geo-location updates lat&lng, app-business sends immediately -->
<app-business url="http://localhost:3000/tracking" period="location"></app-business>

also includes points.json file that containes points between two location. If you pass demo attribute, it simulates these points with period and show on map.

<!-- app-business.html -->
<link rel="import" href="imports.html">
<polymer-element name="app-business" constructor="AppBusiness"
    attributes="demo">
    ...
/* app-business.html */
(function(){
    var demo_ = {};
    demo_.points = [];
    ...
    Polymer({
      demo: false,
      ready: function(){
        if(this.demo){
            // points comes from points.js file
            demo_.points = points;
            ...
        }
      }
      ...
    });
})();
<app-business demo></app-busines>