O'Reilly logo

React and React Native - Second Edition by Adam Boduch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required