mirror of
https://github.com/expo/react-native-maps.git
synced 2026-11-15 09:18:08 -10:00
28 lines
683 B
JavaScript
28 lines
683 B
JavaScript
import * as React from 'react';
|
|
import { TileLayer } from 'react-leaflet';
|
|
|
|
import createLogger from '../utils/createLogger';
|
|
import { transformProps } from './utils/transformProps';
|
|
|
|
const logger = createLogger('Leaflet', 'LocalTile');
|
|
|
|
function localTransformProps(props) {
|
|
return {
|
|
...transformProps(props),
|
|
url: props.urlTemplate,
|
|
maximumZ: props.zIndex,
|
|
};
|
|
}
|
|
|
|
export default class ExpoLocalTile extends React.Component {
|
|
setNativeProps(props) {
|
|
this.ref.setStyleIfChanged(this.props, localTransformProps(props));
|
|
}
|
|
|
|
render() {
|
|
const props = localTransformProps(this.props);
|
|
|
|
return <TileLayer ref={ref => (this.ref = ref)} {...props} />;
|
|
}
|
|
}
|