Dubai Makani No Api - Convert Makani No to and from Map Coordinates and many more.
as some new changes has been made to the makani server the javascript Api Won't work due to CORS errors or 'Access-Control-Allow-Origin' header error. Thus a PHP implementation of the API is provided to bypass the CORs.
include this script tag in your html file, and you are ready to use makani API.
<!-- Place MakaniNo.js in approriate folder first -->
<script src="./src/MakaniNo.js"> </script>
import the makani.php in any of your php file to use it.
// procedural
require Makani.php
// OOP
use Makani;
var No = "30245 95127";
var makani = new MakaniNumber(No);
makani.fetch({
success : function (data) {
if( data.isValid() ) {
//do something..
}
},
fail: function(e) {
//do something..
}
});
$makani_no = "30245 95127";
$data = Makani::Query($makani_no)->toJson();
if(data->valid){
echo "MAKANI IS VALID";
}
var No = "30245 95127";
var makani = new MakaniNumber(No);
makani.fetch({
success : function (data) {
if( data.isValid() ) {
var lat = data.latlng().lat;
var lng = data.latlng().lng;
// your code...
}
},
fail: function(e) {
//do something..
}
});
$makani_no = "30245 95127";
$data = Makani::Query($makani_no)->toJson();
echo "$data->lat , $data->lng";
var No = "30245 95127";
var makani = new MakaniNumber(No);
makani.fetch({
success : function (data) {
if( data.isValid() ) {
var address = data.address();
// your code...
}
},
fail: function(e) {
//do something..
}
});
$makani_no = "30245 95127";
$data = Makani::Query($makani_no)->toJson();
echo $data->address;
var lat = 25.2646373;
var lng = 55.312168;
var makani = MakaniNumber.fromCoord( {
lat : lat,
lng : lng,
success : function (data) {
if (data !== null && data.isValid() )
{
var makani_no = data.makaniNo();
//your code...
}
},
fail: function(e) {
//do something..
}
}
);
$lat = 25.2646373;
$lng = 55.312168;
$data = Makani::fromCoords($lat,$lng)->toString();
echo $data;
a test site is provided out of the box to test your system. it is located here.
all api link are provided by the Dubai Government. this release works as long as their api work. here is the link from where the api is taken.
https://www.makani.ae/MakaniPublicDataService/MakaniPublic.svc