Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dist/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -48458,9 +48458,10 @@ var Map = /** @class */ (function (_super) {
// remove this key when you run it on your localhost.
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyB5o5wtvz2sf_ckQm9rciFuJxc4pp2Sx-o";
script.src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyB5o5wtvz2sf_ckQm9rciFuJxc4pp2Sx-o&callback=initMap";
script.async = true;
script.onloadend = this.onLoaded;
document.body.appendChild(script);
window.initMap = this.onLoaded;
};
Map.prototype.render = function () {
return (React.createElement("div", { id: "map" }));
Expand Down
2 changes: 1 addition & 1 deletion dist/bundle.js.map

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions src/components/Map.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import * as React from "react";

declare global {
interface Window {
initMap: Function;
}
}

export interface MapProps {
getWeather: (lat: number, lng: number) => void;
mapReady: () => void;
Expand All @@ -22,9 +28,10 @@ export default class Map extends React.Component<MapProps, MapState> {
// remove this key when you run it on your localhost.
const script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyB5o5wtvz2sf_ckQm9rciFuJxc4pp2Sx-o";
script.src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyB5o5wtvz2sf_ckQm9rciFuJxc4pp2Sx-o&callback=initMap";
script.async = true;
script.onloadend = this.onLoaded;
document.body.appendChild(script);
window.initMap = this.onLoaded;
}

public render() {
Expand Down