Help to link KML using MapView

#1

Hi Guys.
I am very new at android programming, and would need some help.

May I know how do I link a KML i got to the Expo MapView?

I am currently using this source code:

import React, { Component } from 'react';
import { View, StyleSheet } from 'react-native';
import { Constants, Components } from 'expo';

export default class App extends Component {
  state = {
    mapRegion: { latitude: 1.3521, longitude: 103.8198, latitudeDelta: 0.0922, longitudeDelta: 0.0421 }
  };

  _handleMapRegionChange = mapRegion => {
    this.setState({ mapRegion });
  };

  render() {
    return (
      <View style={styles.container}>
        <Components.MapView
          style={{ alignSelf: 'stretch', height: 500}}
          region={this.state.mapRegion}
          provider={Components.MapView.PROVIDER_GOOGLE}
          onRegionChange={this._handleMapRegionChange}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    paddingTop: Constants.statusBarHeight,
    backgroundColor: '#ecf0f1',
  },
  paragraph: {
    margin: 24,
    fontSize: 18,
    fontWeight: 'bold',
    textAlign: 'center',
    color: '#34495e',
  },
});


Thank you so much for your help!

0 Likes