mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Add tests
This commit is contained in:
@@ -43,6 +43,16 @@ import {
|
||||
Updates
|
||||
} from 'expo';
|
||||
|
||||
import {
|
||||
EdgeInsets,
|
||||
EdgePadding,
|
||||
EventUserLocation,
|
||||
KmlMapEvent,
|
||||
MapEvent,
|
||||
MapStyleElement,
|
||||
Region
|
||||
} from './MapView';
|
||||
|
||||
const reverseGeocode: Promise<Location.GeocodeData[]> = Location.reverseGeocodeAsync({
|
||||
latitude: 0,
|
||||
longitude: 0
|
||||
@@ -837,15 +847,95 @@ async () => {
|
||||
};
|
||||
|
||||
// #region MapView
|
||||
const initialRegion: Region = {
|
||||
latitude: 0,
|
||||
longitude: 0,
|
||||
latitudeDelta: 0,
|
||||
longitudeDelta: 0,
|
||||
};
|
||||
|
||||
const edgePadding: EdgePadding = {
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
};
|
||||
|
||||
const edgeInsets: EdgeInsets = {
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
};
|
||||
|
||||
const mapStyleElements: MapStyleElement[] = [{
|
||||
featureType: 'featureType',
|
||||
elementType: 'elementType',
|
||||
stylers: [{}, {}],
|
||||
}];
|
||||
|
||||
const mapEventCallback = (event: MapEvent) => console.log(event);
|
||||
const regionCallback = (region: Region) => console.log(region);
|
||||
const kmlCallback = (kml: KmlMapEvent) => console.log(kml);
|
||||
const userLocationCallback = (event: EventUserLocation) => console.log(event);
|
||||
|
||||
() => (
|
||||
<MapView
|
||||
provider="google"
|
||||
customMapStyle={mapStyleElements}
|
||||
customMapStyleString="some-string"
|
||||
showsUserLocation={true}
|
||||
userLocationAnnotationTitle="title"
|
||||
showsMyLocationButton={true}
|
||||
followsUserLocation={true}
|
||||
showsPointsOfInterest={true}
|
||||
showsCompass={true}
|
||||
zoomEnabled={true}
|
||||
zoomControlEnabled={true}
|
||||
rotateEnabled={true}
|
||||
cacheEnabled={true}
|
||||
loadingEnabled={true}
|
||||
loadingBackgroundColor="#000"
|
||||
loadingIndicatorColor="#000"
|
||||
scrollEnabled={true}
|
||||
pitchEnabled={true}
|
||||
toolbarEnabled={true}
|
||||
moveOnMarkerPress={true}
|
||||
showsScale={true}
|
||||
showsBuildings={true}
|
||||
showsTraffic={true}
|
||||
showsIndoors={true}
|
||||
showsIndoorLevelPicker={true}
|
||||
mapType="standard"
|
||||
region={initialRegion}
|
||||
initialRegion={initialRegion}
|
||||
liteMode={true}
|
||||
mapPadding={edgePadding}
|
||||
maxDelta={0}
|
||||
minDelta={0}
|
||||
legalLabelInsets={edgeInsets}
|
||||
|
||||
onMapReady={() => ({})}
|
||||
onKmlReady={kmlCallback}
|
||||
onRegionChange={regionCallback}
|
||||
onRegionChangeComplete={regionCallback}
|
||||
onPress={mapEventCallback}
|
||||
onLongPress={mapEventCallback}
|
||||
onUserLocationChange={userLocationCallback}
|
||||
onPanDrag={mapEventCallback}
|
||||
onPoiClick={(event: MapEvent<{ placeId: string, name: string }>) => console.log(event)}
|
||||
onMarkerPress={(event: MapEvent<{ action: 'marker-press', id: string }>) => console.log(event)}
|
||||
onMarkerSelect={(event: MapEvent<{ action: 'marker-select', id: string }>) => console.log(event)}
|
||||
onMarkerDeselect={(event: MapEvent<{ action: 'marker-deselect', id: string }>) => console.log(event)}
|
||||
onCalloutPress={(event: MapEvent<{ action: 'callout-press' }>) => console.log(event)}
|
||||
onMarkerDragStart={mapEventCallback}
|
||||
onMarkerDrag={mapEventCallback}
|
||||
onMarkerDragEnd={mapEventCallback}
|
||||
|
||||
minZoomLevel={0}
|
||||
maxZoomLevel={0}
|
||||
kmlSrc="src"
|
||||
style={{ flex: 1 }}
|
||||
initialRegion={{
|
||||
latitude: 55.6838499,
|
||||
latitudeDelta: 0.1,
|
||||
longitude: 12.5630238,
|
||||
longitudeDelta: 0.1
|
||||
}}
|
||||
/>
|
||||
);
|
||||
// #endegion
|
||||
|
||||
Reference in New Issue
Block a user