I hereby claim:
-
I am kumaraksi on github.
-
I am kumaraksi (https://keybase.io/kumaraksi) on keybase.
-
I have a public key ASDSt5lRVR7uBQa59JsNLSNFrKZYmZBvoAR9W_NOR3yXxQo
I hereby claim:
I am kumaraksi on github.
I am kumaraksi (https://keybase.io/kumaraksi) on keybase.
I have a public key ASDSt5lRVR7uBQa59JsNLSNFrKZYmZBvoAR9W_NOR3yXxQo
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Simple Map</title> | |
<meta name="viewport" content="initial-scale=1.0"> | |
<meta charset="utf-8"> | |
<style> | |
/* Always set the map height explicitly to define the size of the div | |
* element that contains the map. */ | |
#map { |
import {EventBus} from '../../EventBus'; | |
import { GoogleMapScriptLoader } from "../../Service/gmapLoader"; | |
export class GMap extends HTMLElement{ | |
constructor(){ | |
super(); | |
const template = this.getTemplate(); | |
const shadow = this.attachShadow({mode: 'open'}); | |
shadow.appendChild(template.content.cloneNode(true)); |
import { loadScript } from './scriptLoader'; | |
export class GoogleMapScriptLoader { | |
static instance; | |
url; | |
promise; | |
constructor(){ | |
if(GoogleMapScriptLoader.instance){ | |
return GoogleMapScriptLoader.instance |
import './components/gmaps/gmap'; | |
import { EventBus } from "./EventBus"; | |
window.addEventListener('load', function(){ | |
EventBus.getInstance().emit('onLoad') | |
}); |
export class EventBus{ | |
static instance; | |
constructor(){ | |
if(EventBus.instance){ | |
return EventBus.instance | |
} | |
this.subscribers = []; | |
EventBus.instance = this; | |
} | |
static getInstance(){ |
export class GMap extends HTMLElement{ | |
constructor(){ | |
super(); | |
const template = this.getTemplate(); | |
const shadow = this.attachShadow({mode: 'open'}); | |
shadow.appendChild(template.content.cloneNode(true)); | |
} | |
getTemplate(){ |