Plotting overlays

In this last section of this chapter, you'll learn how to render region overlays. A point is a single latitude/longitude coordinate. Think of a region as a connect-the-dots drawing of several coordinates. Regions can serve many purposes, such as showing where we're more likely to find IPA drinkers versus stout drinkers. Here's what the code looks like:

import React, { Component } from 'react';import { View, Text } from 'react-native';import MapView from 'react-native-maps';import { fromJS } from 'immutable';import styles from './styles';// The "IPA" region coordinates and color...const ipaRegion = {  coordinates: [    { latitude: 43.8486744, longitude: -79.0695283 },    { latitude: 43.8537168, longitude: -79.0700046 }, { latitude: ...

Get React and React Native - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.