Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
[
{
"-149.8935557": -149.9054948,
"61.21759217": 61.19533942,
"Starbucks - AK - Anchorage 00001": "Starbucks - AK - Anchorage 00002",
"601 West Street_601 West 5th Avenue_Anchorage, Alaska 99501_907-277-2477": "Carrs-Anchorage #1805_1650 W Northern Lights Blvd_Anchorage, Alaska 99503_907-339-0500"
},
{
"-149.8935557": -149.7522,
"61.21759217": 61.2297,
[
{
"-149.8935557": -149.9054948,
"61.21759217": 61.19533942,
"Starbucks - AK - Anchorage 00001": "Starbucks - AK - Anchorage 00002",
"601 West Street_601 West 5th Avenue_Anchorage, Alaska 99501_907-277-2477": "Carrs-Anchorage #1805_1650 W Northern Lights Blvd_Anchorage, Alaska 99503_907-339-0500"
},
{
"-149.8935557": -149.7522,
"61.21759217": 61.2297,
public addMarker() {
const marker = new google.maps.Marker({
position: {lat: 0, lng: 0},
map: this.map
})
}
ngOnInit() {
const url = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBAyMH-A99yD5fHQPz7uzqk8glNJYGEqus';
this.loadScript(url).then(() => {
this.loadMap()
this.addMarker();
});
}
[
{
"_id": "5cadc6723df0f2a8823c73d7",
"latitude": -65.663127,
"longitude": 32.179976
},
{
"_id": "5cadc6721e27e79449857d75",
"latitude": -20.612127,
"longitude": -54.907892
import { Component, Inject } from '@angular/core';
import { DOCUMENT } from '@angular/common';
import data from './data';
@Component({
selector: 'app-child',
templateUrl: './child.component.html',
styleUrls: ['./child.component.css']
})
private loadScript(url) {
return new Promise((resolve, reject) => {
if ((window as any).google && (window as any).google.maps) {
resolve();
return;
}
const script = this.renderer2.createElement('script');
script.type = 'text/javascript';
script.src = url;
script.text = ``;
import { Component, Inject, Renderer2, AfterViewInit } from '@angular/core';
import { DOCUMENT } from '@angular/common';
declare const google;
@Component({
selector: 'app-map',
templateUrl: './map.component.html',
styleUrls: ['./map.component.css']
})
class TrieNode {
constructor(value, wordEnd = 0) {
this.value = value;
this.wordEnd = wordEnd;
this.count = 0;
this.children = {};
}
}
class Trie {
constructor() {
@hassam7
hassam7 / rxjs.js
Created November 8, 2020 15:29
Rxjs observable
class Observable {
constructor(subscribe) {
this._subscribe = subscribe;
}
subscribe(observer){
return this._subscribe(observer);
}
retry(num) {
const self = this;