[go: up one dir, main page]

Skip to content

doublevie/dzayerjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dzayerjs

Javascript library for algeria cities , build , search , count

#install

<script type="text/javascript" src="dzayerjs.js"></script>

#wilaya

var alger = dzayer.wilaya(16);
var guelma = dzayer.wilaya('guelma');

#commune

var frenda = dzayer.commune('frenda');
console.log(frenda.name);//return Frenda

var wilaya = frenda.origin();// tiaret

#search

//wilayas
var results = dzayer.search( 'al'); // return wilayas
//comunes
var results2 = dzayer.search('ain',true); //return Object

#distance

calculate distance between 2 places

var bouira = dzayer.wilaya('bouira') ,
adrar = dzayer.wilaya('adrar') ,
distance = dzayer.distance(adrar,bouira); // return 1186 
var distance_m = dzayer.distance(adrar,bouira,'m'); // return 1186396

#Closest shows the closest point

// example : closest wilaya to algiers : blida
var x = dzayer.w(15) ,
closest = dzayer.closest(x);
console.log(closest.name) ; //return the closest w to tizi ouezzo

#Furthest

     // example 1
  var w1 = dzayer.wilaya(11) ; // tamanrasset
  var w2 = dzayer.furthest(w1);
  console.log(w2.name); //return Annaba

    // example 2
   var w = dzayer.commune('adrar').origin() ;
  var furthest =dzayer.furthest(w);
  console.log(furthest.name); //return El Taref

About

Javascript library for algeria cities , build , search , count

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published