Skip to content

Instantly share code, notes, and snippets.

View roy-bukapeta's full-sized avatar

Habib Royni Mujtahid roy-bukapeta

View GitHub Profile
var data = [
[2001, 2524.85],
[2002, 1400.12],
[2003, 234.32]
];
// Bagaimana cara menghapus index 2002 ?
// Result
@roy-bukapeta
roy-bukapeta / Update Koreksi Formula Radius
Last active January 11, 2016 16:58
API IUWASH for Mobile App
<?php
namespace app\controllers;
use Yii;
use yii\web\UploadedFile;
use app\models\Formulir;
use dektrium\user\Finder;
use dektrium\user\models\LoginForm;
@roy-bukapeta
roy-bukapeta / sql
Created June 26, 2016 08:09
update type data column nasionality
ALTER TABLE participant ALTER COLUMN nationality TYPE integer USING (nationality::integer);
@roy-bukapeta
roy-bukapeta / MapCanvas.php
Created September 22, 2016 04:21
Function openlayer
public function ScriptOpenlayers(){
/***
* Script dasar openlayers
***/
$setView = explode(",", $this->options['setView']);
$view = $this->getView();
$view->registerJs("
@roy-bukapeta
roy-bukapeta / ol3
Created September 22, 2016 06:02
Example Openlayer3 Add layer vector tile
<!DOCTYPE html>
<html>
<head>
<title>Advanced Mapbox Vector Tiles</title>
<link rel="stylesheet" href="http://openlayers.org/en/v3.18.2/css/ol.css" type="text/css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="http://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
<script src="http://openlayers.org/en/v3.18.2/build/ol.js"></script>
<style>
.map {
@roy-bukapeta
roy-bukapeta / format_data_legenda.json
Created November 22, 2016 10:26
Contoh format untuk legenda
[{"name": "POLA RUANG","token": "token","legend": [{"color": "white","label": "kawasan"}, {"color": "yellow","label": "cagar alam"}]}, {"name": "Bandara","token": "token","legend": [{"color": "white","label": "kawasan"}]}]
<table class="table table-bordered">
<thead>
<tr>
<th>NO</th>
<th>First Name</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<?php
/* @var $this yii\web\View */
use yii\web\view;
use app\components\MapCanvas;
$this->title = 'My Yii Application';
?>
<div class="site-index">
{
"id": "peta-kerja",
"type": "fill",
"source": {
"type": "vector",
"tiles": [
"http://gas.bukapeta.com/bsr/render/859b611e-3c10-499d-ac79-ad90529820ce/cc1bcee1-c5f3-4f0b-830d-b490f9cc55fa/mvt/{z}/{x}/{y}.pbf"
]
},
"layout": {},
{
"id": "peta-kerja",
"type": "fill",
"source": {
"type": "vector",
"tiles": [
"http://gas.bukapeta.com/bsr/render/859b611e-3c10-499d-ac79-ad90529820ce/cc1bcee1-c5f3-4f0b-830d-b490f9cc55fa/mvt/{z}/{x}/{y}.pbf"
]
},
"layers": [