Membuat Boundary Overlay dari File .kml

  1. Siapkan file .kml dan overlay templates 
  2. Salin koordinat dalam file .kml, contoh :
    108.2045265760746,-7.317001165959134,0 108.2044084426807,-7.317890683422466,0 108.2043979662152,-7.319895728169533,0 108.2078565655551,-7.320216474414089,0 108.2084377640402,-7.317014199212683,0 108.204863370317,-7.316467266711261,0 108.2045265760746,-7.317001165959134,0
  3. Replace ,0 (koma nol spasi) Menjadi ‘},{lon:’
  4. Replace ,-7. Menjadi ‘,lat:’-7 , angka 7 tergantung angka koordinat
  5. Hapus ,0 di akhir baris.
  6. Hasil replace menjadi :
    108.2045265760746′,lat:’-7.317001165959134′},{lon:’108.2044084426807′,lat:’-7.317890683422466′},{lon:’108.2043979662152′,lat:’-7.319895728169533′},{lon:’108.2078565655551′,lat:’-7.320216474414089′},{lon:’108.2084377640402′,lat:’-7.317014199212683′},{lon:’108.204863370317′,lat:’-7.316467266711261′},{lon:’108.2045265760746′,lat:’-7.317001165959134
  7. Buka overlay template, insert koordinat pada poin 6 diantara tanda petik pada baris berikut :
    var namakota = [{lon:''}];
  8. Replace nama_overlay, namanegara, namakota sesuai nama yang dikehendaki, pada baris berikut :
    // ==UserScript==
    // @name nama_overlay
    // @namespace
    // @description nama_overlay
    // @include https://www.waze.com/editor/*
    // @include https://www.waze.com/*/editor/*
    // @include https://editor-beta.waze.com/*
    // @version 0.0.4
    // @grant none
    // @copyright Juni 2017 by desoleh
    // ==/UserScript==
    
    var City_mapLayer = new mro_OL.Layer.Vector('nama_overlay', {
    I18n.translations.en.layers.name['__MapCityGroups'] = 'namanegara';
    
    var namakota = [{lon:'108.2045265760746',lat:'-7.317001165959134'},{lon:'108.2044084426807',lat:'-7.317890683422466'},{lon:'108.2043979662152',lat:'-7.319895728169533'},{lon:'108.2078565655551',lat:'-7.320216474414089'},{lon:'108.2084377640402',lat:'-7.317014199212683'},{lon:'108.204863370317',lat:'-7.316467266711261'},{lon:'108.2045265760746',lat:'-7.317001165959134'}];
    
    AddMapPoligon(City_mapLayer,namakota,'#003399','namakota');
    
  9. Buat script baru di tampermonkey, paste isi file overlay template yang telah dimodifikasi.
  10. Semoga berhasil.

Add a Comment

Your email address will not be published. Required fields are marked *