From d675e32fdf2f4e0ca5a7adf8cbc5b462e81bc7f0 Mon Sep 17 00:00:00 2001 From: Aubrey-Li <63608597+Aubrey-Li@users.noreply.github.com> Date: Mon, 5 Jul 2021 13:28:54 -0700 Subject: searchbox zoom in and center on search --- src/client/views/collections/CollectionMapView.tsx | 127 --------------------- 1 file changed, 127 deletions(-) delete mode 100644 src/client/views/collections/CollectionMapView.tsx (limited to 'src/client/views/collections/CollectionMapView.tsx') diff --git a/src/client/views/collections/CollectionMapView.tsx b/src/client/views/collections/CollectionMapView.tsx deleted file mode 100644 index 07755ed71..000000000 --- a/src/client/views/collections/CollectionMapView.tsx +++ /dev/null @@ -1,127 +0,0 @@ -import { GoogleMap, Marker, InfoWindow, LoadScript, GoogleMapProps } from '@react-google-maps/api'; -import { action, computed, Lambda, runInAction } from "mobx"; -import { observer } from "mobx-react"; -import { Doc, DocListCast, Field, FieldResult, Opt } from "../../../fields/Doc"; -import { documentSchema } from "../../../fields/documentSchemas"; -import { Id } from "../../../fields/FieldSymbols"; -import { makeInterface } from "../../../fields/Schema"; -import { Cast, NumCast, ScriptCast, StrCast } from "../../../fields/Types"; -import { LinkManager } from "../../util/LinkManager"; -import { undoBatch, UndoManager } from "../../util/UndoManager"; -import "./CollectionMapView.scss"; -import { CollectionSubView } from "./CollectionSubView"; -import React = require("react"); -import requestPromise = require("request-promise"); - -type MapSchema = makeInterface<[typeof documentSchema]>; -const MapSchema = makeInterface(documentSchema); - -export type LocationData = google.maps.LatLngLiteral & { - address?: string - resolvedAddress?: string; - zoom?: number; -}; - -const mapContainerStyle = { - height: '100%', -}; - - -const defaultCenter = { - lat: 0, - lng: 0, -} -//-----------------------------test map marker----------------------------------- -// const map = new google.maps.Map(document.getElementById('map')!, { -// zoom: 10, -// center: new google.maps.LatLng(-33.92, 151.25), -// mapTypeId: google.maps.MapTypeId.ROADMAP -// }); - -// // test display markers -// let locations = [ -// ['Bondi Beach', -33.890542, 151.274856, 4], -// ['Coogee Beach', -33.923036, 151.259052, 5], -// ['Cronulla Beach', -34.028249, 151.157507, 3], -// ['Manly Beach', -33.80010128657071, 151.28747820854187, 2], -// ['Maroubra Beach', -33.950198, 151.259302, 1] -// ]; - -// const infowindow = new google.maps.InfoWindow(); -// let marker: google.maps.Marker -// let i: number - -// for (i = 0; i < locations.length; i++) { -// marker = new google.maps.Marker({ -// position: new google.maps.LatLng(locations[i][1] as number, locations[i][2] as number), -// map: map -// }); - -// google.maps.event.addListener(marker, 'click', (function (marker, i) { -// return function () { -// infowindow.setContent(locations[i][0] as string); -// infowindow.open(map, marker); -// } -// })(marker, i)); -// } - -//---------------------------------------------------------------- - -@observer -export default class CollectionMapView extends CollectionSubView(MapSchema) { - - - render() { - const { childLayoutPairs } = this; - const { Document, fieldKey, isContentActive: active } = this.props; - - // const { isLoaded, loadError } = useLoadScript({ - // googleMapsApiKey: 'AIzaSyALJU8DfCAqEAS0OqMDCmkE0otlz4H81fg', - // libraries: ['places'] - // }) - - // if (loadError) return "Error loading maps"; - // if (!isLoaded) return "Loading Maps"; - - - return
- -
e.stopPropagation()} - onPointerDown={e => (e.button === 0 && !e.ctrlKey) && e.stopPropagation()} > - -
- - - - -
-
-
-
; - } - -} - -// export default GoogleApiWrapper({ -// // apiKey: process.env.REACT_APP_DASH_GOOGLE_MAPS_API_KEY!, -// apiKey: 'AIzaSyALJU8DfCAqEAS0OqMDCmkE0otlz4H81fg', -// LoadingContainer: () => { -// console.log(process.env.REACT_APP_DASH_GOOGLE_MAPS_API_KEY); -// return
-// -//
; -// } -// })(CollectionMapView) as any; \ No newline at end of file -- cgit v1.2.3-70-g09d2