<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by TomTom Developers on Medium]]></title>
        <description><![CDATA[Stories by TomTom Developers on Medium]]></description>
        <link>https://medium.com/@tomtomdevs?source=rss-4d4fa75dc80------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5al1ZfU2Qx2zJKCG1rrmJg.png</url>
            <title>Stories by TomTom Developers on Medium</title>
            <link>https://medium.com/@tomtomdevs?source=rss-4d4fa75dc80------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 20:25:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tomtomdevs/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[An Introduction to the new TomTom Navigation SDK]]></title>
            <link>https://medium.com/tomtom-developers/an-introduction-to-the-new-tomtom-navigation-sdk-7f9ec2372b37?source=rss-4d4fa75dc80------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f9ec2372b37</guid>
            <category><![CDATA[sdk]]></category>
            <category><![CDATA[navigation]]></category>
            <category><![CDATA[location]]></category>
            <dc:creator><![CDATA[TomTom Developers]]></dc:creator>
            <pubDate>Thu, 17 Nov 2022 00:47:39 GMT</pubDate>
            <atom:updated>2022-11-17T00:47:39.973Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tqMmBN6oALfS9jr5BERi4A.jpeg" /></figure><p>TomTom provides a wide range of geotechnology solutions developers can leverage in building software that solves human problems. One such solution is the new Navigation SDK, aimed at bringing decades of experience in perfecting GPS navigation into our hands in the form of easy-to-use SDKs available on different platforms, including Android and iOS operating systems.</p><p>TomTom’s <a href="https://www.tomtom.com/products/navigation-for-mobile/">Navigation SDK</a> is a powerful and feature-rich tool provided as a set of lightweight modules that allows us to quickly integrate the parts we need into our applications. What this means is that we can readily add features like map visualization, location handling, and driver guidance into our applications without hassle. In this article, we’ll explore the Navigation SDK, its core features, and the advantages of its modular design.</p><h3>TomTom Navigation SDK</h3><p>Navigation is an integral part of the everyday lives of people all over the world. There are countless use cases where we need some form of geotechnology to aid navigation.</p><p>Imagine we’re building a food delivery app that connects drivers, restaurants, and customers. This app’s core would be an effective navigation system with driver guidance. This is because there are restaurants and customers scattered all over the city, and the drivers are required to deliver orders to the correct location as quickly as possible.</p><p>It would be impossible to meet market demands if the drivers weren’t equipped with an effective navigation system. This is an example of how much value we can get from integrating the Navigation SDK.</p><p>The Navigation SDK enables us to build professional navigation applications that are tailored to the end users, which means that we can build navigation features into a wide variety of applications targeting different domains. For example, the navigation system in a food delivery app requires turn-by-turn navigation and voice instructions. If we’re integrating navigation into a ride sharing app, we’ll also need real-time traffic information and accurate ETAs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/0*M8BZyA6LUijyGYm2.jpg" /></figure><h3>Modularization</h3><p>One of the major considerations for developers when integrating external services or adding packages to our applications is the impact of bundle size. The size of the applications we build and ship can have significant effects on performance especially for mobile applications where an end user has to download the whole pre-built binaries.</p><p>TomTom’s Navigation SDK is made of a set of modular components that are independent of each other. This means that we can pick specific components to bring into our applications depending on business and logical requirements, resulting in much less performance cost due to bundle size.</p><p>The modularization of the SDK also gives us the ability to either replace components with implementations from different sources or integrate specific components into existing implementations.</p><p>Let’s consider a scenario where we already have a navigation system baked into our application, but we just want to integrate the voice instructions feature. We can do that by adding the TomTomSDKSystemTextToSpeechEngine. In technical terms, these drop-in components are called engines and they are managed by the orchestrator. Here’s a list of engines that exist in the Navigation SDK:</p><ul><li>Map Matching Engine</li><li>Route Replanning Engine</li><li>Guidance Engine</li><li>Route Deviation Engine</li><li>Route Progress Detection Engine</li><li>Location Context Detection Engine</li><li>Arrival Detection Engine</li></ul><h3>Features of the Navigation SDK</h3><p>TomTom’s new Navigation SDK is a feature-rich toolkit that we can leverage to integrate many geotechnology solutions into the applications we build. Let’s explore some of these features and the kind of solutions we can build with them.</p><h3>Navigation Configuration</h3><p>Navigation configuration is used to customize the Navigation experience to suit your needs. This is the entry point of the integration where we can specify the navigationKey, routingService, and locationEngine parameters. Using the iOS SDK, an example of the configuration would look like this:</p><pre>let configuration = NavigationConfigurationBuilder(<br> navigationKey: &quot;&lt;NAVIGATION-KEY&gt;&quot;,<br> locationEngine: locationEngine,<br> routingService: routingService<br>)<br>.build()<br>locationEngine.start()</pre><p>We can also specify the frequency of ETA updates and the distance and time setting for arrivals. Using the initialized configuration, we can create a navigation object which will enable us to perform some actions like starting and stopping navigation, updating the route, that will enable us to perform some actions like starting and stopping navigation, updating the route, and reporting specific events and reporting specific events that happen during navigation.</p><p>Returning to the example of a food delivery app, part of the business requirements might be to allow drivers to pick up multiple orders at once. This means that at each drop-off, the navigation system will need to re-route to the next drop-off location. We can achieve this by defining a set of route plans ahead of time and then using the update method on the navigation object to change the current route plan to the next drop-off location.</p><h3>Route and Maneuver Information</h3><p>Navigation is not always a straightforward or definitive process. Multiple factors can influence the route information provided. Weather conditions could cause a road blockage, or construction work could lead to heavy traffic on the road. It’s essential to take these factors into consideration. The Continuous Replanning component gives us this ability. With it, we can perform route refreshes in the background and check for better route alternatives without sacrificing user experience.</p><p>Additionally, the Continuous Replanning component is also fully customizable, meaning we can define configuration options like automatic or manual replanning mode or even disable continuous replanning entirely, depending on the kind of behavior we require.</p><p>We can also specify the time interval between route replans and the minimum time difference between routes before deciding to use an alternative route, and specify other configuration options like the route replanning policy and providing a custom better route selector.</p><p>One important factor to consider when building certain applications that require navigation is security. In a ride sharing app, it’s necessary to be able to tell in real-time when a driver deviates from the navigated route. Developers can easily integrate this feature using the Route Deviation configuration. The ability to make these types of granular configurations makes it easy for us to build rich navigation experiences that are tailored to specific use cases.</p><h3>Maps Integration</h3><p>Navigation and maps go hand-in-hand. We can think of maps as the visual tool necessary to build a complete navigation solution because they provide more context to navigation. TomTom provides a Maps SDK as a separate toolkit, but it’s easy to combine the Maps SDK and the Navigation SDK to create a highly interactive navigation experience using built-in UI components or custom components.</p><h3>Planned or Unplanned</h3><p>The Navigation SDK provides support for both unplanned journeys and planned routes. We’ve talked about navigation in the context of pre-defined routes. In planned routes, a RoutePlan is provided to the navigation object when the start method is called, and the route plan can be constantly updated throughout navigation.</p><p>On the other hand, unplanned journeys, also known as free driving, is navigation without a route. In free driving, we can get details about the current location, such as speed limit, country code, road characteristics, and so on, by setting up a location context.</p><p>There are many cases where this type of feature would be useful. Suppose we want to add a feature to our food delivery app that allows the driver to turn on an idle mode when they’re not picking up orders but still want access to navigation information like the speed limit. This is easy to implement because we can readily switch the driving mode between turn-by-turn navigation and free driving using the update method on the navigation object.</p><h3>Instructions</h3><p>Guidance instructions are a set of detailed information about navigation. They can be in the form of text or voice messages, and the developer can relay this information to the user as they see fit. Instructions and the channel in which we relay them are vital. If we’re integrating navigation into an app for drivers, then it’s necessary to have voice instructions because we cannot compromise road safety rules by having the driver read messages from the app.</p><p>The navigation module uses text-to-speech (TTS) functionality for generating voice instructions. Using the TTS engine, we can generate voice synthesis for messages. On the iOS SDK, initializing a TTS engine using the default SystemTextToSpeechEngine would look like this:</p><pre>let languageCode = &quot;en-Gb&quot;<br>let tts = SystemTextToSpeechEngine(language: languageCode)<br>self.tts = makeTextToSpeech(ttsEngine: tts)Conclusion</pre><p>We can then call the play method to synthesize provided messages. Instructions can also be configured just like other parts of the Navigation SDK. For example, the underlying language of the engine can be changed. In the code snippet above, we specified en-Gb as the underlying language. This is particularly important for internationalization if the application we’re building will be used by people in different locations around the world.</p><h3><strong>Conclusion</strong></h3><p>In this article, we explored the new TomTom Navigation SDK at a high level. The Navigation SDK is a feature-rich toolkit that enables developers to build many different geotechnology solutions. The modular approach to designing the SDK makes it easy to integrate specific features without compromising on factors like bundle size.</p><p>You can learn more about integrating the Navigation SDK into your applications by trying <a href="https://developer.tomtom.com/ios/navigation/documentation/overview/introduction">TomTom’s Navigation SDK</a> for yourself!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f9ec2372b37" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tomtom-developers/an-introduction-to-the-new-tomtom-navigation-sdk-7f9ec2372b37">An Introduction to the new TomTom Navigation SDK</a> was originally published in <a href="https://medium.com/tomtom-developers">TomTom Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using TomTom Maps with React Routing]]></title>
            <link>https://blog.devgenius.io/using-tomtom-maps-with-react-routing-ebe0f8aacef1?source=rss-4d4fa75dc80------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebe0f8aacef1</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[TomTom Developers]]></dc:creator>
            <pubDate>Tue, 26 Jul 2022 14:01:36 GMT</pubDate>
            <atom:updated>2022-11-17T08:54:53.362Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7XbjED3kmexj3AH7KGf_7g.jpeg" /></figure><p>Map integration is integral to products like vehicle fleet monitoring apps and ridesharing services. However, building a map from the start is challenging, and it can take a long time to develop a stable prototype. Instead of trying to find or create a map and integrate it on our own, we can save time (and a lot of trouble) by using the <a href="https://developer.tomtom.com/products/maps-api">TomTom Map APIs</a>, Maps SDK, and Map Styler. The Maps APIs include the Map Display API, the Map Routing API, and the Map Traffic API. The Map APIs enable us to integrate maps into our products easily and effectively.</p><p>The Map APIs communicate with TomTom’s <a href="https://developer.tomtom.com/products/maps-sdk">Maps SDK</a>, which provides all necessary methods for map manipulation. With the Maps SDK and Maps API combined, we can set markers on maps, search for places, use reverse geocoding, and much more.</p><p>This tutorial demonstrates how to use the TomTom Maps API, Maps SDK, and a <a href="https://reactrouter.com/">React Router</a> to dynamically update a map by connecting TomTom maps to React Routing.</p><h3>Tutorial Overview</h3><p>In this tutorial, we’ll integrate a map with a React application. The map shows different countries. With the help of React routing, we’ll display another country by appending the country’s name to the URL in the address bar and searching for it using the <a href="https://developer.tomtom.com/search-api/search-api-documentation">TomTom Search API</a>.</p><h3>Prerequisites</h3><p>To follow this article, you need the following:</p><ul><li>A basic understanding of React. To get a basic understanding of integrating a map in React, check out this <a href="https://developer.tomtom.com/blog/build-different/adding-tomtom-maps-modern-react-app">article</a>. You must have Node.js installed on your system since you use the Node package manager to install different tools. If you’re familiar with Yarn, you can use it, but we won’t cover it in this tutorial.</li><li>A TomTom developer account. After <a href="https://developer.tomtom.com/user/register">signing up</a> for this account, you’ll get an API key that you use for your app.Getting Started We start by creating and running a React app. Do this by executing the following command in your terminal:</li></ul><pre>1 npx create-react-app tomtom-map</pre><pre>2 cd tomtom-map</pre><pre>3 npm start</pre><p>After that, a new browser tab with the address localhost:3000 opens. Whenever you make changes to your code, the tab refreshes and renders appropriately.</p><p>The code also automatically creates a new directory with the name of the app. Change into the src directory under the app directory created by create-react-app. In the directory, open the App.css file, and add this cascading style sheet (CSS) styling for the map. The styling sets the map’s height to 100 percent of the viewport.</p><pre>1.mapDiv{</pre><pre>2  height: 100vh;</pre><pre>3}</pre><p>In the next sections, we’ll modify the App.js file step by step. As a reminder, this file is in the src directory.</p><h3>Installing and Adding the Dependencies</h3><p>To avoid possible errors, remove the &lt;header/&gt; element so that a near-empty component remains resembling the one below. Also, note the removal of the logo image import.</p><pre>1import &#39;./App.css&#39;;</pre><pre>2</pre><pre>3function App() {</pre><pre>4  return (</pre><pre>5    &lt;div className=&quot;App&quot;&gt;</pre><pre>6    &lt;/div&gt;</pre><pre>7  );</pre><pre>8}</pre><pre>9</pre><pre>10export default App;</pre><p>In this file, we need to add the Map’s SDK dependencies and react-router-dom for routing. Because these dependencies don’t come bundled with React, we must install them using the following command:</p><pre>npm i @tomtom-international/web-sdk-maps @tomtom-international/web-sdk-services</pre><pre>react-router-dom</pre><p>Then, we add the dependencies using this snippet:</p><pre>1import &#39;./App.css&#39;;</pre><pre>2import &#39;@tomtom-international/web-sdk-maps/dist/maps.css&#39;</pre><pre>3import mapSDK from &#39;@tomtom-international/web-sdk-maps&#39;;</pre><pre>4import mapServices from &#39;@tomtom-international/web-sdk-services&#39;;</pre><pre>5import { React, useState, useEffect, useRef } from &#39;react&#39;</pre><pre>6import {</pre><pre>7  BrowserRouter as Router,</pre><pre>8  Routes,</pre><pre>9  Route,</pre><pre>10  useParams</pre><pre>11} from &#39;react-router-dom&#39;;</pre><h3>Setting the Map</h3><p>To begin, remove the line export default App since we won’t be exporting the App component by default. Instead, we use the App component to get the coordinates and display the map.</p><p>To do so, begin by exporting a component called CountryNameHelper with the snippet below:</p><pre>1<em>/*This maps a country name URL parameter in the search bar*/</em></pre><pre>2export default function CountryNameHelper() {</pre><pre>3  return (</pre><pre>4    &lt;Router&gt;</pre><pre>5      &lt;div&gt;</pre><pre>6</pre><pre>7</pre><pre>8</pre><pre>9        &lt;Routes&gt;</pre><pre>10          &lt;Route exact path=&quot;/:countryName&quot; element={&lt;App /&gt;} /&gt;</pre><pre>11</pre><pre>12</pre><pre>13</pre><pre>14        &lt;/Routes&gt;</pre><pre>15</pre><pre>16</pre><pre>17</pre><pre>18      &lt;/div&gt;</pre><pre>19    &lt;/Router&gt;</pre><pre>20  );</pre><pre>21}</pre><p>The snippet creates a route with a country name parameter (countryName) that you use in the App component.</p><p>Add the following code in the App functional component, which contains a constant to store your API key, gets the country name parameter using the useParams method, instantiates the map, and then uses state hooks to store initial state variables appropriately.</p><pre>1  <em>//your API key</em></pre><pre>2  const API_KEY = &#39;&#39;</pre><pre>3  <em>//getting the country&#39;s name from the URL</em></pre><pre>4  let { countryName } = useParams();</pre><pre>5  const mapContainer = useRef();</pre><pre>6  <em>//default coordinates</em></pre><pre>7  const [countryLongitude, setCountryLongitude] = useState(-121.91599);</pre><pre>8  const [countryLatitude, setCountryLatitude] = useState(37.36765);</pre><pre>9  <em>//use this to change the zoom level of the map</em></pre><pre>10  const [zoomLevel, setZoomLevel] = useState(3);</pre><pre>11  const [ourMap, setMap] = useState({});</pre><p>After that, fetch the coordinates for the typed country’s capital city using the <a href="https://developer.tomtom.com/maps-sdk-web-js/documentation#Services.services.fuzzySearch">fuzzy search service</a>, access the values, and appropriately set them. Pick the first value, position 0, since it returns the result with the highest score.</p><pre>1<em>//fetching the coordinates for the typed country&#39;s administrative capital city</em></pre><pre>2  mapServices.services.fuzzySearch({</pre><pre>3    key: API_KEY,</pre><pre>4    query: countryName</pre><pre>5  }).then(getCoordinates);</pre><pre>6</pre><pre>7  function getCoordinates(response) {</pre><pre>8    console.log(response.results)</pre><pre>9    let latitude = response.results[0][&quot;position&quot;][&quot;lat&quot;];</pre><pre>10</pre><pre>11    let longitude = response.results[0][&quot;position&quot;][&quot;lng&quot;];</pre><pre>12</pre><pre>13    setCountryLatitude(latitude)</pre><pre>14</pre><pre>15    setCountryLongitude(longitude)</pre><pre>16  }</pre><p>Using the default coordinates when the page loads, use a useEffect hook to render the map. This hook passes in the API key, map container, the coordinates, and the zoom level to the SDK’s map object. Note that this tutorial uses a zoom level of three to give us a larger field of view of the country and its borders.</p><p>Now, render the map using the setMap method with the map object (ourMap) as the argument.</p><pre>1useEffect(() =&gt; {</pre><pre>2</pre><pre>3    let ourMap = mapSDK.map({</pre><pre>4      key: API_KEY,</pre><pre>5      container: mapContainer.current,</pre><pre>6      center: [countryLongitude, countryLatitude],</pre><pre>7      zoom: zoomLevel</pre><pre>8    });</pre><pre>9    setMap(ourMap);</pre><pre>10    <em>/*values to listen to*/</em></pre><pre>11  }, [countryLongitude, countryLatitude]);</pre><p>Setting a location marker helps quickly identify the target location. After the setMap method, add this code:</p><pre>1let locationMarker = new mapSDK.Marker({</pre><pre>2      draggable: false</pre><pre>3    }).setLngLat([countryLongitude, countryLatitude]).addTo(ourMap);</pre><p>We set the properties we need in the Marker constructor, set the coordinates to place the marker using the setLngLat method, and then add it to the map using the addTo method. Finally, we unmount the map component from the DOM to listen for other changes and refresh it using this method. It comes after the code for setting the marker.</p><pre>return () =&gt; ourMap.remove();</pre><p>Note: This tutorial recreates the map each time a new country is selected, which works for demonstration purposes. In practice, it’s more efficient to create the map instance once and use an additional effect to update the view based on coordinate values.</p><p>We use the array (the second parameter for the useEffect hook) for setting the values to listen for changes. Doing this eliminates the need to use a button and method to update the map. This is the full useEffect hook’s code:</p><pre>1  useEffect(() =&gt; {</pre><pre>2</pre><pre>3    let ourMap = mapSDK.map({</pre><pre>4      key: API_KEY,</pre><pre>5      container: mapContainer.current,</pre><pre>6      center: [countryLongitude, countryLatitude],</pre><pre>7      zoom: zoomLevel</pre><pre>8    });</pre><pre>9    setMap(ourMap);</pre><pre>10    <em>//setting the location marker to help easily identify the target*/</em></pre><pre>11    let locationMarker = new mapSDK.Marker({</pre><pre>12      draggable: false</pre><pre>13    }).setLngLat([countryLongitude, countryLatitude]).addTo(ourMap);</pre><pre>14</pre><pre>15</pre><pre>16</pre><pre>17    return () =&gt; ourMap.remove();</pre><pre>18    <em>/*values to listen to*/</em></pre><pre>19  }, [countryLongitude, countryLatitude]);</pre><p>In the return method, add a &lt;div&gt; inside the App &lt;div&gt; for displaying the map.</p><p>Here are screenshots of the app running routes for several countries: a USA route, a South Africa route, and a Norway route.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lvqT2gcX2D8srjBe.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IU3f8Pi88xzuwN8L.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1Bwwl-vbBrTq-4Yb.jpg" /></figure><h3>Conclusion</h3><p>In this tutorial, we’ve seen how to get a country’s name from a URL, search for the country’s coordinates using the Search API, and display the map based on the coordinates retrieved. With TomTom maps, it’s effortless and painless to integrate a map in a React app and use the React Router for changing the location displays.</p><p>To learn more about TomTom’s map technology, <a href="https://developer.tomtom.com/user/register">sign up</a> for a developer account and get started with TomTom today.</p><p><em>This article was originally published at </em><a href="https://developer.tomtom.com/blog">developer.tomtom.com/blog</a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebe0f8aacef1" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/using-tomtom-maps-with-react-routing-ebe0f8aacef1">Using TomTom Maps with React Routing</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using the Snap to Roads API with React]]></title>
            <link>https://medium.com/tomtom-developers/using-the-snap-to-roads-api-with-react-7ab9820218ba?source=rss-4d4fa75dc80------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ab9820218ba</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[TomTom Developers]]></dc:creator>
            <pubDate>Mon, 25 Jul 2022 18:32:38 GMT</pubDate>
            <atom:updated>2022-07-25T18:32:38.572Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mhlbne3WMpiP4DnszpXkrw.jpeg" /></figure><p>TomTom’s Snap to Roads API uses GPS data to reconstruct driver journeys. The API matches location data with road network information to determine the most probable route.</p><p>The Snap to Roads API also takes other factors into account, such as what type of vehicle is being driven, speed limits, lanes, and the amount of time it has previously taken the driver to reach various locations. These factors are sent as parameters by the REST API.</p><p>You can also record multiple point coordinates along the driver’s journey. Then, we can take these point coordinates and send them to the API, which takes the coordinates and returns relevant information about the coordinate routes. The API’s response can also include more descriptive details on the road traveled, such as names, types of roads, speed restrictions, class of road, etc.</p><p>Snap to Roads allows for smooth visualization of relevant information in ride-hailing services and on-demand delivery applications. It’s also useful for route tracking in fleet logistics and insurance applications. You can use it for information about road attributes, such as speed limit, elevation, and road ownership.</p><p>In this article, we’ll build a demo in which we’ll input two location coordinates, send this information to the Snap to Roads API, and draw the returned routes on our TomTom maps. This will provide a helpful visual representation of the new routes and how to use them.</p><h3>Getting Started</h3><p>There are many ways to spin up a React application, but it’s advisable to use the <a href="https://github.com/facebook/create-react-app">Create React App</a> (CRA) library.</p><p>Let’s jump straight to the code. To create a React app using <a href="https://github.com/facebook/create-react-app">Create React App</a>, make sure you currently have Node.js installed. You can check to see if you have Node.js installed by typing the following into your terminal:</p><pre>node -v</pre><p>If Node.js is installed, that command should return the current version. If not, go to the Node.js website and <a href="https://nodejs.org/en/download/">download the latest version</a>.</p><p>Next, go into the terminal/command prompt and initiate your app using the name.</p><pre>npx create-react-app snap-to-road</pre><p>Navigate into your project folder:</p><pre>cd snap-to-road</pre><p>You can now start the project:</p><pre>npm start</pre><p>You need to be able to send API requests with your endpoints, so you need an API key from TomTom maps. <a href="https://developer.tomtom.com/user/login">Sign in to TomTom</a>, generate an API key, and edit it to enable the Snap to Roads API:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*0tBUJHE7HKZ0lUUX.jpg" /></figure><h3>Installation</h3><p>Before you can use TomTom in your app, you’ll have to install the TomTom package and <a href="https://github.com/axios/axios">axios</a>:</p><pre>npm install @tomtom-international/web-sdk-maps -save</pre><p>Axios will allow us to make API requests to the Snap to Roads API:</p><pre>npm i axios</pre><h3>Adding the TomTom Map</h3><p>Now, let’s go into the component where we will create the map:</p><pre>1import &quot;./styles.css&quot;;</pre><pre>2import &quot;@tomtom-international/web-sdk-maps/dist/maps.css&quot;;</pre><pre>3import * as ttmaps from &quot;@tomtom-international/web-sdk-maps&quot;;</pre><pre>4import { useState, useEffect, useRef } from &quot;react&quot;;</pre><pre>5</pre><pre>6export default function App() {</pre><pre>7  const mapElement = useRef();</pre><pre>8  const [mapZoom, setMapZoom] = useState(17);</pre><pre>9  const [map, setMap] = useState({});</pre><pre>10</pre><pre>11  useEffect(() =&gt; {</pre><pre>12    let map = ttmaps.map({</pre><pre>13      key: &quot;{{TOMTOM_API_KEY}}&quot;,</pre><pre>14      container: mapElement.current,</pre><pre>15      center: [12.3, 32.992578],</pre><pre>16      zoom: mapZoom</pre><pre>17    });</pre><pre>18    setMap(map);</pre><pre>19    return () =&gt; map.remove();</pre><pre>20  }, []);</pre><pre>21</pre><pre>22  return (</pre><pre>23    &lt;div className=&quot;App&quot;&gt;</pre><pre>24      &lt;div ref={mapElement} className=&quot;mapDiv&quot;&gt;&lt;/div&gt;</pre><pre>25    &lt;/div&gt;</pre><pre>26  );</pre><pre>27}</pre><p>This imports the TomTom library and displays it in the DOM using React’s useRef.</p><p>Next, import the TomTom library and default CSS styles into App.js. You’ll also import useState and useEffect.</p><p>You need to add certain values, like the map zoom value and the map itself using useState. Then, you can initialize the map with useEffect and display it with mapElement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tvnBW_VlLOY3GCne.jpg" /></figure><h3>Using the Snap to Roads API</h3><p>Now, let’s say we’re moving from point A (4.6104, 52.3757) to point B (4.6140, 52.3834). As we send these coordinates to the API, we also send two parameters: fields and key (our API key). The fields object contains the specific information you need from the API endpoint. For this example, this appears as follows:</p><pre>1{</pre><pre>2    projectedPoints {</pre><pre>3        type,</pre><pre>4        geometry {</pre><pre>5            type,</pre><pre>6            coordinates</pre><pre>7        },</pre><pre>8        properties {</pre><pre>9            routeIndex</pre><pre>10        }</pre><pre>11    }, route {</pre><pre>12        type,</pre><pre>13        geometry {</pre><pre>14            type,</pre><pre>15            coordinates</pre><pre>16        },</pre><pre>17        properties {</pre><pre>18            id,</pre><pre>19            speedRestrictions {</pre><pre>20                maximumSpeed {</pre><pre>21                    value,</pre><pre>22                    unit</pre><pre>23                }</pre><pre>24            }</pre><pre>25        }</pre><pre>26    }</pre><pre>27}</pre><p>You can also find more nested fields sample objects in our <a href="https://developer.tomtom.com/snap-to-roads-api/api-explorer">documentation</a>.</p><p>Let’s get back to the code. Within the component, import axios and create a getSnapFunction that makes a request to the API.</p><pre>1import axios from &quot;axios&quot;</pre><pre>2</pre><pre>3const getSnapFunction = () =&gt; {</pre><pre>4    axios.get(&quot;https://api.tomtom.com/snap-to-roads/1/snap-to-roads?points=4.6104,52.3757;4.6140,52.393&amp;fields={projectedPoints{type,geometry{type,coordinates},properties{routeIndex}},route{type,geometry{type,coordinates},properties{id,speedRestrictions{maximumSpeed{value,unit}}}}}&amp;key=8h504Wc4AXL6OPndqhrtKf70AovVBL3V&quot;).then((res) =&gt;</pre><pre>5    {</pre><pre>6     console.log(res.data)</pre><pre>7     res.data.route.forEach(</pre><pre>8      (item) =&gt; {</pre><pre>9        map.addLayer({</pre><pre>10          id: Math.random().toString(),</pre><pre>11          type: &quot;line&quot;,</pre><pre>12          source: {</pre><pre>13            type: &quot;geojson&quot;,</pre><pre>14            data: {</pre><pre>15              type: &quot;FeatureCollection&quot;,</pre><pre>16              features: [</pre><pre>17                {</pre><pre>18                  type: &quot;Feature&quot;,</pre><pre>19                  geometry: {</pre><pre>20                    type: &quot;LineString&quot;,</pre><pre>21                    properties: {},</pre><pre>22                    coordinates: item.geometry.coordinates</pre><pre>23                  }</pre><pre>24                }</pre><pre>25              ]</pre><pre>26            }</pre><pre>27          },</pre><pre>28          layout: {</pre><pre>29            &quot;line-cap&quot;: &quot;round&quot;,</pre><pre>30            &quot;line-join&quot;: &quot;round&quot;</pre><pre>31          },</pre><pre>32          paint: {</pre><pre>33            &quot;line-color&quot;: &quot;#ff0000&quot;,</pre><pre>34            &quot;line-width&quot;: 2</pre><pre>35          }</pre><pre>36        });</pre><pre>37      }</pre><pre>38     )</pre><pre>39       map.setCenter([parseFloat(4.6104), parseFloat(52.3757)]);</pre><pre>40   }).catch((err) =&gt; console.log(err))</pre><pre>41  }</pre><p>This returns the reconstructed route. Then, it loops this response through the route array.</p><p>Next, we used map.addLayer to draw each property of the array on the map. It now forms the full route, taking you from the takeoff point to the destination.</p><p>Finally, map.setCenter enables us to center the map on the route. Here’s the final map:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*71B6Q6MNeHR0qLr_.jpg" /></figure><p>We’ve just covered the Synchronous Snap to Roads API. However, there’s also an Asynchronous Snap to Roads API, where users make a POST request and get back a batch ID. While making this request, we will send the several coordinate points and the query property within the body.</p><pre>1axios.post(&#39;https://api.tomtom.com/snap-to-roads/batch/1?key={TOMTOM_API_KEY}&#39;, {</pre><pre>2  {</pre><pre>3  batchItems: [</pre><pre>4    {</pre><pre>5      query: &quot;/snap-to-roads?fields={projectedPoints{type,geometry{type,coordinates},properties{routeIndex}},route{type,geometry{type,coordinates},properties{id,speedRestrictions{maximumSpeed{value,unit}},address{roadName,roadNumbers,municipality,countryName,countryCode,countrySubdivision},elementType,traveledDistance,privateRoad,partOfTunnel,frc,formOfWay,roadUse,laneInfo{numberOfLanes},heightInfo{height,chainage},trafficSign{signType,chainage},trafficLight}},distances{total,ferry,privateRoad,publicRoad,road,offRoad}}&amp;vehicleType=PassengerCar&amp;measurementSystem=imperial&quot;,</pre><pre>6      post: {</pre><pre>7        points: [</pre><pre>8          {</pre><pre>9            type: &quot;Feature&quot;,</pre><pre>10            geometry: {</pre><pre>11              type: &quot;Point&quot;,</pre><pre>12              coordinates: [</pre><pre>13                19.4389141359581,</pre><pre>14                51.78057462411982</pre><pre>15              ]</pre><pre>16            }</pre><pre>17          },</pre><pre>18          {</pre><pre>19            type: &quot;Feature&quot;,</pre><pre>20            geometry: {</pre><pre>21              type: &quot;Point&quot;,</pre><pre>22              coordinates: [</pre><pre>23                19.439257458711324,</pre><pre>24                51.78057794294989</pre><pre>25              ]</pre><pre>26            }</pre><pre>27          },</pre><pre>28          {</pre><pre>29            type: &quot;Feature&quot;,</pre><pre>30            geometry: {</pre><pre>31              type: &quot;Point&quot;,</pre><pre>32              coordinates: [</pre><pre>33                19.43963296797358,</pre><pre>34                51.78064100067553</pre><pre>35              ]</pre><pre>36            }</pre><pre>37          },</pre><pre>38          {</pre><pre>39            type: &quot;Feature&quot;,</pre><pre>40            geometry: {</pre><pre>41              type: &quot;Point&quot;,</pre><pre>42              coordinates: [</pre><pre>43                19.44012113001449,</pre><pre>44</pre><pre>45</pre><pre>46</pre><pre>47</pre><pre>48</pre><pre>49</pre><pre>50</pre><pre>5151.780690783028064</pre><pre>52              ]</pre><pre>53            }</pre><pre>54          }</pre><pre>55        ]</pre><pre>56      }</pre><pre>57    },</pre><pre>58    {</pre><pre>59      &quot;query&quot;: &quot;/snap-to-roads?fields={projectedPoints{type,geometry{type,coordinates},properties{routeIndex}},route{type,geometry{type,coordinates},properties{id,speedRestrictions{maximumSpeed{value,unit}},address{roadName,roadNumbers,municipality,countryName,countryCode,countrySubdivision},elementType,traveledDistance,privateRoad,partOfTunnel,frc,formOfWay,roadUse,laneInfo{numberOfLanes},heightInfo{height,chainage},trafficSign{signType,chainage},trafficLight}},distances{total,ferry,privateRoad,publicRoad,road,offRoad}}&amp;vehicleType=PassengerCar&amp;measurementSystem=metric&quot;,</pre><pre>60      post: {</pre><pre>61        points: [</pre><pre>62          {</pre><pre>63            type: &quot;Feature&quot;,</pre><pre>64            geometry: {</pre><pre>65              type: &quot;Point&quot;,</pre><pre>66              coordinates: [</pre><pre>67                19.4389141359581,</pre><pre>68                51.78057462411982</pre><pre>69              ]</pre><pre>70            }</pre><pre>71          },</pre><pre>72          {</pre><pre>73            type: &quot;Feature&quot;,</pre><pre>74            geometry: {</pre><pre>75              type: &quot;Point&quot;,</pre><pre>76              coordinates: [</pre><pre>77                19.439257458711324,</pre><pre>78                51.78057794294989</pre><pre>79              ]</pre><pre>80            }</pre><pre>81          },</pre><pre>82          {</pre><pre>83            type: &quot;Feature&quot;,</pre><pre>84            geometry: {</pre><pre>85              type: &quot;Point&quot;,</pre><pre>86              coordinates: [</pre><pre>87                19.4389141359581,</pre><pre>88                51.78057462411982</pre><pre>89              ]</pre><pre>90            }</pre><pre>91          },</pre><pre>92          {</pre><pre>93            type: &quot;Feature&quot;,</pre><pre>94            geometry: {</pre><pre>95              type: &quot;Point&quot;,</pre><pre>96              coordinates: [</pre><pre>97                19.439257458711324,</pre><pre>98                51.78057794294989</pre><pre>99              ]</pre><pre>100            }</pre><pre>101          },</pre><pre>102          {</pre><pre>103            type: &quot;Feature&quot;,</pre><pre>104            geometry: {</pre><pre>105              type: &quot;Point&quot;,</pre><pre>106              coordinates: [</pre><pre>107                19.43963296797358,</pre><pre>108                51.78064100067553</pre><pre>109              ]</pre><pre>110            }</pre><pre>111          },</pre><pre>112          {</pre><pre>113            type: &quot;Feature&quot;,</pre><pre>114            geometry: {</pre><pre>115              type: &quot;Point&quot;,</pre><pre>116              coordinates: [</pre><pre>117                19.44012113001449,</pre><pre>118                51.780690783028064</pre><pre>119              ]</pre><pre>120            }</pre><pre>121          }</pre><pre>122        ]</pre><pre>123      }</pre><pre>124    }</pre><pre>125  ]</pre><pre>126}</pre><pre>127})</pre><p>The response will contain a batch ID:</p><pre>1{</pre><pre>2    &quot;batchId&quot;: &quot;16178e70-8331-459f-abc8-251e708f5edb&quot;</pre><pre>3}</pre><p>We now take this batch ID and send another request to another endpoint, checking the status of our Snap API request:</p><pre>axios.get(&#39;https://api.tomtom.com/snap-to-roads/batch/1/c435cae3-c8f2-4d76-b08b-304529c967eb/status?key={TOMTOM_KEY}&#39;).then((res) =&gt; console.log(res.data)).catch((err) =&gt; console.log(err)</pre><p>If it’s ready, it will return Completed.</p><pre>1{</pre><pre>2  &quot;state&quot;: &quot;Completed&quot;,</pre><pre>3  &quot;statistics&quot;: {</pre><pre>4    &quot;totalCount&quot;: 2,</pre><pre>5    &quot;successes&quot;: 2</pre><pre>6  }</pre><pre>7}</pre><p>As the processing of batch data may take some time to complete, it is important to check the status before attempting to obtain the route data. Attempting to download route data before processing has completed will result in an error.</p><p>Once the process is complete, you can get the route data by sending a GET request to the download endpoint. This sends a response with the route data. The route data will take the shape of the query property in the body of the POST request we sent earlier.</p><pre>axios.get(&#39;https://api.tomtom.com/snap-to-roads/batch/1/c435cae3-c8f2-4d76-b08b-304529c967eb?key={TOMTOM_KEY}&#39;).then((res) =&gt; console.log(res.data)).catch((err) =&gt; console.log(err)</pre><h3>Conclusion</h3><p>Now that you know how to use TomTom’s Snap to Roads API to retrieve relevant information about a set of route coordinates, and display the route on a map in our React app, you can start using this API in your own applications. For example, you could use this API to create a fleet logistics application that analyzes delivery drivers’ routes and speed. You can use this to determine how fast delivery orders are fulfilled.</p><p>Synchronous Snap to Roads is best for analyzing single trips. If you need to analyze batches of trips in one call, try Asynchronous Snap to Roads.</p><p>To learn more about each endpoint of this API, explore the following resources:</p><ul><li>Video: <a href="https://www.youtube.com/watch?v=Kq5aPrv3SCw">Track and manage assets while on the road</a></li><li><a href="https://developer.tomtom.com/snap-to-roads-api/documentation/snap-to-roads-api/synchronous-snap-to-roads">Synchronous Snap to Roads</a></li><li>Asynchronous Snap to Roads:</li><li><a href="https://developer.tomtom.com/snap-to-roads-api/documentation/snap-to-roads-api/asynchronous-snap-to-roads-submission">Submission:</a> Send an HTTPS POST request that responds with a unique job ID</li><li><a href="https://developer.tomtom.com/snap-to-roads-api/documentation/snap-to-roads-api/asynchronous-snap-to-roads-status">Status:</a> Check the status of a submitted job</li><li><a href="https://developer.tomtom.com/snap-to-roads-api/documentation/snap-to-roads-api/asynchronous-snap-to-roads-download">Download:</a> Download the results of your submission</li></ul><p>Visit the <a href="https://developer.tomtom.com/snap-to-roads-api/documentation/snap-to-roads-api/asynchronous-snap-to-roads-download">TomTom Developer Portal</a> to learn more about TomTom Maps.</p><p><em>This article was originally published at </em><a href="https://developer.tomtom.com/blog">developer.tomtom.com/blog</a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ab9820218ba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tomtom-developers/using-the-snap-to-roads-api-with-react-7ab9820218ba">Using the Snap to Roads API with React</a> was originally published in <a href="https://medium.com/tomtom-developers">TomTom Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding TomTom Maps to a Gatsby App]]></title>
            <link>https://medium.com/tomtom-developers/adding-tomtom-maps-to-a-gatsby-app-b83a2c7eef8a?source=rss-4d4fa75dc80------2</link>
            <guid isPermaLink="false">https://medium.com/p/b83a2c7eef8a</guid>
            <category><![CDATA[mapping]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[gatsbyjs]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[location]]></category>
            <dc:creator><![CDATA[TomTom Developers]]></dc:creator>
            <pubDate>Thu, 14 Jul 2022 20:20:33 GMT</pubDate>
            <atom:updated>2022-07-14T20:20:33.857Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A7EBoKf0mtfZYXHRSx6X8A.jpeg" /></figure><p>These days, maps are an essential feature of many web applications. More platforms are starting to offer services that use location technology. TomTom enables you to integrate location-based features into your web applications through its software development kits (SDKs) and APIs with just a few lines of code and minimal development time.</p><p>The TomTom Maps SDK integrates capably with many popular front-end frameworks — including Gatsby, an open-source static website generator that you can use to build progressive web apps that are secure and optimized for speed. Pairing the TomTom Maps SDK with Gatsby enables you to create optimized, interactive maps with ease.</p><p>In this tutorial, we’ll demonstrate how to integrate TomTom maps into a Gatsby site using modern React practices like <a href="https://reactjs.org/docs/refs-and-the-dom.html">refs</a>. We’ll also see how to display data from an external source on the map. Finally, we’ll explore how to build routes to and from specific destinations that can be altered based on the type of goods being transported.</p><h3>Prerequisites</h3><p>To follow this tutorial, you’ll need to have:</p><ul><li>A basic understanding of React.</li><li>Node.js installed on your computer.</li><li>A developer account with TomTom and an API key to authorize your request to use the service.</li></ul><h3>Setting Up a New Gatsby App</h3><p>To create a new Gatsby app, we need the Gatsby command-line interface (CLI) installed on your computer. This will enable you to run the commands for developing Gatsby sites.</p><p>To install the CLI, open up a terminal on your machine and run the following command. It installs the CLI globally or updates your version to the most recent release.</p><p>npm install -g gatsby-cli</p><p>Next, use the cd command to navigate to where you want to create your Gatsby site. For example:</p><p>cd Desktop</p><p>To create the Gatsby site, we’ll use a Gatsby starter template. This premade template enables us to get started with development quickly. In this tutorial, we’ll use Gatsby’s official <a href="https://www.gatsbyjs.com/starters/gatsbyjs/gatsby-starter-hello-world">hello world starter</a>.</p><p>Inside the directory for your site, run this command (replacing name-of-your-project-here with your project name):</p><pre>npx gatsby new name-of-your-project-here <a href="https://github.com/gatsbyjs/gatsby-starter-hello-world">https://github.com/gatsbyjs/gatsby-starter-hello-world</a></pre><p>When the installation is complete, you should see this message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/0*qe-MTKv0iZ2tAp0K.jpg" /></figure><p>Go to the directory you created for the site and run gatsby develop, which will launch a development server where you can preview your site. You can view it at <a href="http://localhost:8000/">http://localhost:8000</a> in a web browser. The result should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*RK3_bVZ_IA8jhT_l.jpg" /></figure><h3>Adding a TomTom Map</h3><p>With the Gatsby app now up and running, we’re set to add a TomTom map to our site. First, we’ll need the TomTom Maps Web SDK installed in our project.</p><p>In the terminal, in the root directory of the site, run the command below to install the SDK and its dependencies:</p><p>npm install @tomtom-international/web-sdk-maps</p><p>With the SDK installed, it’s time to write out the code to display a TomTom map. Open the index.js file within the src/pages folder of your Gatsby app. Clear all the code inside it and populate it with the following code:</p><pre>import * as React from &quot;react&quot;<br>import { useEffect, useRef } from &quot;react&quot;</pre><pre>// TomTom SDK<br>import * as tt from &quot;<a href="http://twitter.com/tomtom">@tomtom</a>-international/web-sdk-maps&quot;<br>import &quot;<a href="http://twitter.com/tomtom">@tomtom</a>-international/web-sdk-maps/dist/maps.css&quot;</pre><p>This imports the resources we’ll need to display a TomTom map on a React site, including the useEffect and useRef React hooks along with the TomTom maps JavaScript SDK and its default stylesheet.</p><p>Next, we define the functional component Home where the application will live.</p><pre>export default function Home() {<br>  const API_KEY = &quot;YOUR_API_KEY&quot;<br>  const AMSTERDAM = { lon: 4.896029, lat: 52.371807 }</pre><pre>const map = useRef()<br>const mapContainer = useRef()</pre><pre>useEffect(() =&gt; {<br>    map.current = tt.map({<br>      key: API_KEY,<br>      container: mapContainer.current.id,<br>      center: AMSTERDAM,<br>      zoom: 10,<br>      language: &quot;en-GB&quot;,<br>    })</pre><pre>map.current.addControl(new tt.FullscreenControl())<br>    map.current.addControl(new tt.NavigationControl())</pre><pre>return () =&gt; {<br>      map.current.remove()<br>    }<br>    //eslint-disable-next-line<br>  }, [])</pre><pre>return (<br>    &lt;div className=&quot;&quot;&gt;<br>      &lt;div className=&quot;container&quot;&gt;<br>        &lt;nav className=&quot;nav&quot;&gt;<br>          &lt;h1&gt; TomTom Maps in Gatsby&lt;/h1&gt;<br>        &lt;/nav&gt;<br>        &lt;div ref={mapContainer} className=&quot;map&quot; id=&quot;map&quot; /&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  )<br>}</pre><p>There’s quite a lot going on in the code above, so let’s break it down.</p><p>First, the variables API_KEY and AMSTERDAM store the value of the TomTom API key, which you’ll need to use the service. It also includes the longitude and latitude coordinates of Amsterdam in the Netherlands, our sample location, so the map can be centered around it.</p><p>Remember to replace YOUR_API_KEY with the API key from your TomTom developer account.</p><p>The useRef hook defines the variables map and mapContainer, which stores references to our map and the DOM element it’s embedded within. This is necessary because React works with something called the <a href="https://reactjs.org/docs/faq-internals.html#what-is-the-virtual-dom">virtual DOM</a>, which is a virtual representation of the real DOM. We can’t render a TomTom map to a piece of React’s virtual DOM — we have to work with actual DOM elements, which can only be accessed through refs.</p><p>These variables are defined as refs and not regular JavaScript variables because in React the entire component is re-rendered whenever a variable is updated, leading to data loss in the component. Since we don’t want to lose this data, we wrap them in refs so that their value persists between component re-renders and you can update their values without a re-render.</p><p>The useEffect hook initiates a TomTom map on page load by calling the tt.map function with the necessary configurations. These configurations include our API key, the container parameter that takes the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id">ID</a> of the HTML element the map is to be embedded in, and the center parameter that centers the map around Amsterdam. Note how all it takes to initialize a TomTom map is calling a function!</p><p>Finally, the return statement returns the HTML for the browser to display.</p><p>At this stage, we’ve now successfully added a TomTom map to our Gatsby site. However, the site would be a bit bleak if it were viewed right now. To solve this, we’ll create a new CSS file in the src folder called styles.css. Note that if you wish to name yours something else, you’ll need to ensure it is imported correctly into your React component.</p><p>Once we’ve created the file, we populate it with the following CSS styles:</p><pre>* {<br>  padding: 0;<br>  margin: 0;<br>  box-sizing: border-box;<br>}<br>.container {<br>  width: 100vw;<br>  height: 100vh;<br>  display: flex;<br>  flex-direction: column;<br>  justify-content: space-around;<br>  align-items: center;<br>  position: relative;<br>}</pre><pre>.nav {<br>  display: flex;<br>  justify-content: space-around;<br>  align-items: center;<br>  width: 100%;<br>  height: 10%;<br>  background-color: #000;<br>  color: #ffffff;<br>}</pre><pre>.nav h1 {<br>  padding-top: 0.3125rem;<br>  padding-bottom: 0.3125rem;<br>  margin-right: 1rem;<br>  font-size: 1.25rem;<br>  text-decoration: none;<br>  white-space: nowrap;<br>}</pre><pre>.map {<br>  width: 100%;<br>  height: 90%;<br>}</pre><p>Now, import the stylesheet at the top of the index.js file, which applies styles to make it look better than un-styled HTML.</p><pre>// CSS styles<br>import &quot;../styles.css&quot;</pre><p>With the development server running, save the new changes and go to localhost:8000 in a web browser. When the page updates, it should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*GOx4h5KdM8M_ur1t.jpg" /></figure><h3>Adding Markers to a TomTom Map</h3><p>TomTom lets us display a range of information on a map, including geofences, navigation routes, images, and videos. It also lets us display <a href="https://developer.tomtom.com/maps-sdk-web-js/documentation#Maps.Marker">markers</a>, which are customizable icons that add information and interactivity to our maps.</p><p>To demonstrate, let’s use markers to show the locations of some top-rated restaurants in Amsterdam. In the src folder, create a JSON file called stores.json, and enter the following code:</p><pre>[<br>{<br>&quot;coordinates&quot;: [<br>4.88427,<br>52.37243<br>],<br>&quot;address&quot;: &quot;Reestraat 8, 1016 DN Amsterdam&quot;<br>},<br>{<br>&quot;coordinates&quot;: [<br>4.87631,<br>52.36366<br>],<br>&quot;address&quot;: &quot;Eerste Helmersstraat 33, 1054 CZ Amsterdam&quot;<br>},<br>{<br>&quot;coordinates&quot;: [<br>4.94036,<br>52.36357<br>],<br>&quot;address&quot;: &quot;Javaplein 23, 1095 CJ Amsterdam&quot;<br>},<br>{<br>&quot;coordinates&quot;: [<br>4.92089,<br>52.38213<br>],<br>&quot;address&quot;: &quot;Gedempt Hamerkanaal 201, 1021 KP Amsterdam&quot;<br>},<br>{<br>&quot;coordinates&quot;: [<br>4.91191,<br>52.36619<br>],<br>&quot;address&quot;: &quot;Plantage Middenlaan 30A, 1018 DG Amsterdam&quot;<br>},<br>{<br>&quot;coordinates&quot;: [<br>4.87896,<br>52.37257<br>],<br>&quot;address&quot;: &quot;Rozengracht 133A, 1016 LV Amsterdam&quot;<br>}<br>]</pre><p>Here, we have an array of objects, where each object has the property of a coordinate. This coordinate is an array that stores the longitude and latitude coordinates of the location — here, a restaurant — and its street address. These coordinates are obtained from the Fuzzy Search service in TomTom’s <a href="https://developer.tomtom.com/search-api/api-explorer">API Explorer</a>, which returns geolocational data of an address, such as longitude and latitude coordinates and points of interest (POIs).</p><p>At the top of the index.js file, below the import statements, import the JSON file:</p><p>Import stores from &quot;../stores.json&quot;</p><p>Now, to display the markers on the page, paste the code below in the useEffect hook just above the return statement.</p><pre>stores.map((store) =&gt; {<br>      const address = store?.address<br>      const location = store?.coordinates<br>      return new tt.Marker()<br>        .setLngLat(location)<br>        .setPopup(new tt.Popup({ offset: 35 }).setHTML(address))<br>        .addTo(map.current)<br>    })</pre><p>The code above uses the JavaScript map method to iterate over the array from the JSON file that stores the details of the restaurants. For each restaurant it does the following:</p><ul><li>Retrieves its address and coordinates.</li><li>Creates a new marker by calling the tt.Marker class.</li><li>Sets that marker around the restaurant’s geographical location by passing the restaurant’s longitude and latitude coordinates to the setLngLat method.</li><li>Calls the setPopup method, which will display a cancelable popup that shows the restaurant address when the marker is clicked.</li><li>Attaches the marker to the map.</li></ul><p>Viewed in a browser, the restaurant locations are now displayed as markers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*INwZy82sQdm4ZfWD.jpg" /></figure><p>Clicking on a marker displays the popup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*chv4O41QOv-8K1mE.jpg" /></figure><h3>Routing</h3><p>Among the many features TomTom offers to developers through its SDKs, routing is one of the most valuable and easy to implement. For example, in a ride-sharing application, how can drivers identify the best routes to their destination? Or for someone working in deliveries, how can they optimize their daily route? In both of these instances, access to information on the route is vital.</p><p>TomTom’s Calculate Route service solves this with the Routing API, which determines possible routes between two locations based on specific parameters, like the type of vehicle, the load it’s carrying, and the driver’s estimated time of arrival.</p><p>To demonstrate routing with TomTom, let’s make a delivery route between two restaurants that will be altered if the vehicle is carrying hazardous kitchen products, like propane for grills.</p><p>First, we need to install TomTom’s web services SDK, which lets us integrate TomTom services on our project, as they aren’t offered by the TomTom Maps Web SDK.</p><p>In the terminal, within the root directory of your site, run this command:</p><p>npm install @tomtom-international/web-sdk-services</p><p>Once it’s installed, add this to the top of your index.js file to import it.</p><p>import * as tts from &quot;@tomtom-international/web-sdk-services&quot;</p><p>You can now start writing out the code to calculate the route.</p><p>In the Home component, just above the useEffect hook where the map is initialized, declare the function createRoute:</p><pre>function createRoute() { <br>    ...<br>}</pre><p>Next, within the function, insert the following object:</p><pre>const routeOptions = {<br>      key: API_KEY,<br>      locations: [<br>        [4.87631, 52.36366],<br>        [4.91191, 52.36619],<br>      ],<br>      travelMode: &quot;truck&quot;,<br>      vehicleEngineType: &quot;electric&quot;,<br>      vehicleCommercial: true,<br>    }</pre><p>This object contains the configurations that are being passed to the Calculate Route service, like the API key that authorizes the service, the longitude and latitude coordinates of the two restaurants the route is to be constructed around, the type of vehicle on the route (here, a truck), or the engine type of the vehicle.</p><p>Below the routeOptions object, insert this code:</p><pre>tts.services.calculateRoute(routeOptions).then(response =&gt; {<br>      console.log(response.toGeoJson())<br>      console.log(response)<br>      var geojson = response.toGeoJson()<br>      map.current.addLayer({<br>        id: &quot;route&quot;,<br>        type: &quot;line&quot;,<br>        source: {<br>          type: &quot;geojson&quot;,<br>          data: geojson,<br>        },<br>        paint: {<br>          &quot;line-color&quot;: &quot;#a51414&quot;,<br>          &quot;line-width&quot;: 8,<br>        },<br>      })</pre><pre>var bounds = new tt.LngLatBounds()<br>      geojson.features[0].geometry.coordinates.forEach(function (point) {<br>        bounds.extend(tt.LngLat.convert(point)) // creates a bounding area<br>      })<br>      map.current.fitBounds(bounds, {<br>        duration: 300,<br>        padding: 50,<br>        maxZoom: 14,<br>      }) // zooms the map to the searched route<br>    })</pre><p>Here, the tts.services.calculateRoute function calls the calculate route service, passing the routeOptions object as an argument. This creates the route, draws its path on the map, and zooms in on it.</p><p>Next, we need to be able to call the service on our site. Insert this code into the HTML that the Home component returns:</p><pre>&lt;button<br>    className=&quot;btn&quot;<br>    onClick={e =&gt; {<br>    e.preventDefault()<br>        createRoute()<br>    }}<br>    &gt;<br>      calculate route<br>&lt;/button&gt;</pre><pre>Add these CSS styles to the styles.css file:</pre><pre>.btn {<br>  position: fixed;<br>  bottom: 4rem;<br>  left: 50%;<br>  border-radius: 0.5rem;<br>  transform: translate(-50%, 0);<br>  border: none;<br>  padding: 1.2rem 1rem;<br>  background: #000;<br>  color: #fff;<br>  font-size: 1.3rem;<br>  cursor: pointer;<br>}</pre><p>Now, clicking the <strong>calculate route</strong> button will now call the Calculate Route service and construct a route between the two restaurant markers on the map.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*u08Eq2RzT4x_Pn6O.jpg" /></figure><p>To prove that the route between the two markers changes based on the type of load specified in the truck, add this property to the routeOptions object:</p><p>vehicleLoadType: [&quot;otherHazmatHarmfulToWater&quot;]</p><p>This property lets you specify what type of goods are in the vehicle. Passing on that value to the array tells the Calculate Route service that the truck is loaded with goods that are water pollutants. As a result, the service constructs a different route the vehicle can take to avoid proximity to water.</p><p>Here’s the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*LIzt1ncuQCGfQZHP.jpg" /></figure><h3>Wrapping Up</h3><p>In this tutorial, we built a web application with Gatsby that displays a TomTom map and constructs an alterable route between two marker locations using TomTom’s Maps Web SDK.</p><p>If you want to integrate such features into your application, there’s no better location technology provider than TomTom. <a href="https://developer.tomtom.com/user/register">Sign up for a free developer account</a> to integrate TomTom’s location services into your application today. Happy mapping!</p><p><em>This article was originally published at </em><a href="https://developer.tomtom.com/blog">developer.tomtom.com/blog</a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b83a2c7eef8a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tomtom-developers/adding-tomtom-maps-to-a-gatsby-app-b83a2c7eef8a">Adding TomTom Maps to a Gatsby App</a> was originally published in <a href="https://medium.com/tomtom-developers">TomTom Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Collaborative Map Editing can keep Maps Fresh in High-growth Areas]]></title>
            <link>https://medium.com/tomtom-developers/how-collaborative-map-editing-can-keep-maps-fresh-in-high-growth-areas-c1e5045830bd?source=rss-4d4fa75dc80------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1e5045830bd</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[geospatial]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[mapping]]></category>
            <category><![CDATA[location-intelligence]]></category>
            <dc:creator><![CDATA[TomTom Developers]]></dc:creator>
            <pubDate>Thu, 07 Jul 2022 20:02:59 GMT</pubDate>
            <atom:updated>2022-07-07T20:02:59.322Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d8_rhhIVb3ogo3T1E9nPxQ.jpeg" /></figure><p>The world is changing by the minute. And, thanks to localized economic development and sudden population growth, some places are changing faster than others. Keeping up with that change isn’t easy.</p><p>The emergence of boomtowns — a town that experiences rapid population and economic growth — around the world poses an ever-evolving challenge to mapmakers who aim for their maps to reflect the real world as closely as possible and keep them fresh and accurate.</p><p>Boise, located on the Boise River in southwestern Idaho, USA, is one such town. Labelled the fastest growing city in the US in 2018 by Forbes, the capital of Idaho has been drawing in tens of thousands of new residents each year due to its affordable cost of living, desirable work-life balance and proximity to nature. The boom intensified with the COVID-19 pandemic as remote working became the norm and the allure of the fast-paced big city life began to dwindle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*Y2ay6obXHW1JsiTP.jpg" /></figure><p>Drawing tens of thousands of new residents every year, Boise, Idaho, has emerged as one of the fastest growing cities in the USA.</p><p>The need to make the city more livable for its new inhabitants led to development of all kinds of new facilities, be it housing, schools, hospitals or entertainment venues. Naturally, growing cities also require an expansion of road networks to connect the growing population.</p><p>One of the first considerations to make when finding a place to live in a new city is how accessible local amenities like schools, supermarkets, public transport and healthcare centers are. Without accurate and up-to-date digital maps, acquiring local knowledge about a rapidly developing city you’ve just moved to, in this day and age, is virtually impossible.</p><p>Not only does this inconvenience residents, but also enterprise businesses operating in that area who rely on the services of mapmakers, like TomTom, to make deliveries and run their fleets of vehicles.</p><p>“Say a street in a rapidly developing city like Boise has 10 houses on it, and each of those 10 houses receives 10 deliveries a year, which are made by our customers. That’s about 100 times a year that they’re calling on our map service, and if this street isn’t accurately mapped, we’re not able to fulfill our responsibility, costing them precious time and money,” says Saul Nochumson who leads product development as part of TomTom’s Community and Partnership team.</p><p>It can be frustrating to expect a delivery, and then find it being returned or delivered to a neighbour because your address wasn’t accurately displayed on a digital map. Fresh location data is also critical when it comes to ensuring that maps can guide their users around obstacles, such as construction sites or road closures.</p><p>With the world changing so rapidly, mapmakers must determine where exactly these changes are happening, so these areas can be given special attention and mapped accordingly.</p><h3>Identifying areas that need attention</h3><p>TomTom uses a multi-source approach to detect changes in the world that need to be reflected on its maps, including data from <a href="https://www.tomtom.com/blog/maps/mobile-mapping-journey/">survey vehicles</a>, <a href="https://www.tomtom.com/blog/navigation/way-out-of-the-coronavirus-chip-shortage/">GPS traces</a>, community input, governmental sources, and vehicle sensor data among others. This doesn’t just ensure the accuracy of maps, but also that locations such as Boise don’t slip off mapmakers’ radar.</p><p>TomTom also relies on “local intelligence”, or several regional sourcing specialists who monitor factors such as population growth and migration patterns across states to predict which areas are “booming” and require more attention.</p><p>“Using city-level, sometimes even county-level analysis, we’ve seen Boise becoming very popular for West Coast migration, making it an important spot for us,” says Peter King, who leads work on sourcing operations for the western half of the USA in TomTom’s map unit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*TnxID4QPmI-WyQjM.jpg" /></figure><p>The population boom in Boise has led to subsequent urban development, requiring mapmakers to take note and ensure digital maps reflect these changes quickly and accurately.</p><p>Government data can also make for a helpful resource. For example, every month, the US Postal Service adds new addresses — now receiving mail — to its records. The monthly address update is another useful source to alert mapmakers about potential changes in the world that need to be mapped.</p><p>“The US government actively tracks migration from state to state, and individual municipalities also provide us with sources to feed into our maps,” says King. “In this case, we have been working with the state of Idaho for several years. When they released state-wide geographical data a little over two years ago, we were able to zoom in on Boise and compare the localities with what our maps recognized. As the speed of development increased, so did our focus on the area.”</p><p>Once these areas have been identified, the question of how to edit the map arises. While mapmakers generally automate map editing to make it a smooth process, it’s not always the best choice. It might not work as well in areas that develop rapidly, like Boise, as it does in what King calls “maintenance geographies” — established areas like New York City (NYC) or Amsterdam where the volume of map changes is much lower.</p><h3>Where automation fails</h3><p>Automation enables changes to be added to the base map without much human intervention. Essentially, new location data containing additions, modifications or deletions to the map comes as a data set, after which it’s lumped together and added onto the current map.</p><p>Once the data has been ingested, the map can then be cleaned up for minor inaccuracies such as misspelled street names. This works reasonably well in a city like NYC, which is already more or less established. Changes usually amount to the closure of a road or opening of a new shop at the most.</p><p>However, King explains, a map is like a patchwork quilt of data — made up from several different sources that vary significantly from each other in terms of quality but can work together with careful crafting.</p><p>To lump together sources and automate ingestion of this data by the map without analyzing the quality of each source would mean risking the degradation of data and sacrificing quality. At the same time, examining each new change for quality makes the process painfully slow, causing valuable source material to be left unused or get so old it’s no longer useful.</p><h3>One step closer</h3><p>To address the downsides of automation and help update maps for boomtowns quicker than manual processes allow, King and his colleagues created a new tool. Known as the Proactive Sourcing tool (PAS), it compares the incoming data with changes against the data currently being reflected on the map.</p><p>To put it simply, if every delivery from a source is compared to the original base map, there will always be a lot of differences, TomTom Regional Sourcing Specialist Thomas Byker tells me. So, PAS takes the newest data from a source and compares it against the last delivered version, and then you only see the smaller changes that the source provider has added within that time period. This means that the editing process can remain hyper focused on the changes that are freshly happening in a specific area.</p><p>This new approach promises faster returns than complete automation. When it comes to accuracy, maps updated by PAS using source material can only be as accurate as the source data itself, which is highly variable. In rapidly growing suburban areas especially, obstructions like tree cover combined with mountainous topography can make it difficult to quickly assess the quality of source data, according to TomTom Regional Sourcing Specialist Kurt McClure.</p><p>So, while PAS could help keep up with how fast cities like Boise expand, there is still scope to address accuracy. As it turns out, that’s possible using another in-house map editor.</p><h3>A collaborative approach to map editing</h3><p>Since October 2020, King’s team has been using Vertex, a visual map editor designed to ensure both freshness and overall quality of map data for TomTom and its partners.</p><p>“We wanted to take a more proactive approach to map editing. We saw the need for a tool to process numerous high-quality leads and sources at a faster speed. So, we provided a semi-automated solution that empowers mapmakers instead of having them depend on automated processes, especially in high-growth areas,” says Nochumson, who manages the day-to-day development of the tool.</p><p>Using a combination of local knowledge, aerial imagery and probe data, Vertex automatically proposes map updates to human editors — who then have the option to accept or reject them.</p><p>King’s team already has data from countless different sources made available for ingestion by the PAS tool. By importing it into Vertex as an editable layer, this data can act as a base for the proposed changes.</p><p>Think of it as a dish with ingredients sourced from different places. Map data prepared by PAS, when entered in what is called the Automated Road Tool (ART) layer in Vertex, results in map changes for editors to consider. Editors can also adjust the dish to their taste, by incorporating elements like missing or incorrect street names.</p><p>In a little over a year, the ART has generated over 50,000 kilometers of new road updates for editors to consider, not limited to Boise, but also including other similar geographies like Denton, Texas. This is a vast improvement from complete automation, the method mapmakers relied on earlier, which risked maps going stale in areas like Boise due to the varying quality of source data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*HpoNNUAkW0P6L_1w.jpg" /></figure><p>Boise has been developing rapidly over the past few years. Using the ART layer in Vertex, TomTom mapmakers can make map edits in a much easier and faster way.</p><p>According to TomTom Senior Project Manager David Salmon, Vertex allows for a faster turnaround due to lower barriers to entry. “We can now do away with weeks and weeks of editing training, wherein we had to prepare the map to automatically ingest not just source data, but also specific attributes such as POI data or lane attribution on roads. By adding the ART layer in Vertex, anybody within TomTom can contribute to map freshness. And since the sourcing operations team is instantly alerted of this change, they can get in the data much faster, improving the map editing cycle.”</p><p>Of course, there is the question of how efficient this process really is if each proposed change needs to be manually approved. As Salmon sees it, the updates proposed by ART are much smaller in volume than the large-scale updates made by automated processes in maintenance geographies.</p><p>“In a single city like Boise, we might only be adding 10 new streets on a given day, allowing us to really focus on the minute details.”</p><p>While the process that led to its adoption might seem complex, using Vertex to keep maps fresh and accurate is as simple as it sounds.</p><p>As the world expands and several big cities fall prey to housing crises, people are increasingly choosing to migrate to smaller towns. Using this map editing technique, TomTom mapmakers can help them make informed decisions about where to build their new life, and easily find their way around their new city.</p><h3>Learn more</h3><p>To get started mapping with TomTom Maps APIs and SDKs, <a href="http://developer.tomtom.com/">register for a free acount</a> and API key on our developer portal.</p><p>For more reading, learn more about TomTom’s <a href="https://www.tomtom.com/blog/maps/map-editing-partnership-program/">Map Editing Partnership program</a> and our <a href="https://www.tomtom.com/products/map-technology/">map technology</a>.</p><p><em>Note: This article originally appeared on the TomTom blog. The article can be found </em><a href="https://www.tomtom.com/blog/maps/how-mapmakers-keep-on-top-of-boomtowns/"><em>here</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1e5045830bd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tomtom-developers/how-collaborative-map-editing-can-keep-maps-fresh-in-high-growth-areas-c1e5045830bd">How Collaborative Map Editing can keep Maps Fresh in High-growth Areas</a> was originally published in <a href="https://medium.com/tomtom-developers">TomTom Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create a Satellite Map Using the Maps SDK]]></title>
            <link>https://tomtomdevs.medium.com/how-to-create-a-satellite-map-using-the-maps-sdk-8980d127f36e?source=rss-4d4fa75dc80------2</link>
            <guid isPermaLink="false">https://medium.com/p/8980d127f36e</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[satellite-technology]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[sdk]]></category>
            <dc:creator><![CDATA[TomTom Developers]]></dc:creator>
            <pubDate>Mon, 27 Jun 2022 22:09:09 GMT</pubDate>
            <atom:updated>2022-06-27T22:09:09.456Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W0GLAuxbClzDj-ZE99oYtQ.jpeg" /></figure><p>As part of our partnership with <a href="https://blog.maxar.com/earth-intelligence/2022/tomtom-maps-gain-greater-context-with-updated-views-of-earth-from-maxar">Maxar</a>, we can now offer satellite tiles to our developer community as part of our Map Display API! Satellite imagery tiles are now available as part of the Raster Tile service. They can be used on their own, or can be combined with vector tiles, displaying road networks, map labels and POIs as an overlay on top.</p><p>In this tutorial we’ll walk you through how to get started by creating a satellite map using TomTom’s Maps SDK and satellite tiles, and then configuring the map to allow us to see POIs. This map will be a vector map automatically, but incorporate satellite tiles with a simple change to the code which integrates them as a map style.</p><p>You can also <a href="https://developer.tomtom.com/map-display-api/documentation/raster/satellite-tile">browse the documentation</a> of the satellite style within our Raster Tile docs before creating your first satellite map.</p><h3>Getting started</h3><p>We’ll start by creating a basic HTML file, embedding the Maps SDK and its stylesheet in the head of the document. We’re loading the SDK from TomTom’s CDN (Content Delivery Network), if however, you’re using Node.js and a module bundler like Webpack you can install the SDK via npm. You can find documentation on installing the SDK with npm and alternative download options in the <a href="https://developer.tomtom.com/maps-sdk-web-js/overview/product-information/downloads#npm">Maps SDK documentation</a>.</p><p>We’ve added a div element as the first child of the document body which will be the DOM element the map will be rendered to. We’ve included an “id” attribute on this element which we’ll use when the map object is created so the SDK knows which element to use as the map container.</p><pre>&lt;!DOCTYPE html&gt; <br>&lt;html&gt; <br>  &lt;head&gt; <br>    &lt;script src=&quot;<a href="https://api.tomtom.com/maps-sdk-for-web/cdn/6.x/6.18.0/maps/maps-web.min.js">https://api.tomtom.com/maps-sdk-for-web/cdn/6.x/6.18.0/maps/maps-web.min.js</a>&quot;&gt;&lt;/script&gt; <br>    &lt;link <br>      rel=&quot;stylesheet&quot; <br>      type=&quot;text/css&quot; <br>      href=&quot;<a href="https://api.tomtom.com/maps-sdk-for-web/cdn/6.x/6.18.0/maps/maps.css">https://api.tomtom.com/maps-sdk-for-web/cdn/6.x/6.18.0/maps/maps.css</a>&quot; <br>    /&gt; <br>  &lt;script&gt;(function(){ window.SS = window.SS || {}; SS.Require = function (callback){ if (typeof callback === &#39;function&#39;) { if (window.SS &amp;&amp; SS.EventTrack) { callback(); } else { var siteSpect = document.getElementById(&#39;siteSpectLibraries&#39;); var head = document.getElementsByTagName(&#39;head&#39;)[0]; if (siteSpect === null &amp;&amp; typeof head !== &#39;undefined&#39;) { siteSpect = document.createElement(&#39;script&#39;); siteSpect.type = &#39;text/javascript&#39;; siteSpect.src = &#39;/__ssobj/core.js+ssdomvar.js+generic-adapter.js&#39;;siteSpect.async = true; siteSpect.id = &#39;siteSpectLibraries&#39;; head.appendChild(siteSpect); } if (window.addEventListener){ siteSpect.addEventListener(&#39;load&#39;, callback, false); } else { siteSpect.attachEvent(&#39;onload&#39;, callback, false); } } } };})(); &lt;/script&gt; &lt;/head&gt; <br>  &lt;body&gt; <br>    &lt;div id=&quot;map&quot;&gt;&lt;/div&gt; <br>  &lt;/body&gt; <br>&lt;/html&gt;</pre><h3>Adding a TomTom map</h3><p>To create the map, we’re going to add a script block after the map container element we added earlier. We’ll define a constant with the value of our TomTom API key (if you don’t have one already visit the <a href="https://developer.tomtom.com/how-to-get-tomtom-api-key">How to get a TomTom API key page</a>) and use its value in the initialization of the map object. We’re also passing the value of the “id” of the map container element as the “container” option.</p><pre>&lt;div id=&quot;map&quot;&gt;&lt;/div&gt; <br>&lt;script&gt; <br>  const API_KEY = &quot;&lt;YOUR-API-KEY&gt;&quot;; <br> <br>  const map = tt.map({ <br>    key: API_KEY, <br>    container: &quot;map&quot; <br>  }); <br>&lt;/script&gt;</pre><p>We now have a functional map but to make it visible in our browser we need to specify the map dimensions. Let’s add a style block to the head of the document to do that, with a selector targeting the map container element.</p><pre>&lt;style&gt; <br>  #map { <br>    width: 100vw; <br>    height: 100vh; <br>  } <br>&lt;/style&gt;</pre><p>If you now load the page in your browser, you should see a map sized to the browser window. By default, the Maps SDK creates a vector-based map, in the next step we’ll configure the map to use TomTom’s satellite map tiles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*qLrRyXeWvbDVOD-x.jpg" /></figure><h3>Configuring the map to use satellite map tiles</h3><p>To use the satellite map tiles, we need make only one change to our map initialization code, adding the “style” option to override the default style with a satellite style provided by TomTom. We’re using the <a href="https://developer.tomtom.com/map-display-api/documentation/mapstyles/map-styles-v2#merged-style-method">Merged style method</a>, provided by the Maps API Resource service to combine the satellite style along with a POI style to show points of interest on our satellite map.</p><p>The satellite map can be further customized with traffic information by appending two additional styles to the map style URL, the “light” variants are preferred for greater contrast:</p><ul><li>traffic_incidents=2/incidents_light. Displays traffic incident icons.</li><li>traffic_flow=2/flow_relative-light. Displays traffic congestion.</li></ul><p>Lastly, note the wildcard character “*” in the style URL is used to request the latest style resource version. If you wanted to request a specific version, you would specify it in this position in the URL path e.g. “22.1.4–0”.</p><pre>const map = tt.map({ <br>  key: API_KEY, <br>  container: &quot;map&quot;, <br>  style: `<a href="https://api.tomtom.com/style/1/style/*?map=2/basic_street-satellite&amp;poi=2/poi_dynamic-satellite&amp;key=${API_KEY}`">https://api.tomtom.com/style/1/style/*?map=2/basic_street-satellite&amp;poi=2/poi_dynamic-satellite&amp;key=${API_KEY}`</a> <br>});</pre><p>If you reload the page in your browser, you’ll now see the map is now using TomTom’s satellite tiles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*JSNOTRVJrYoLM7CV.jpg" /></figure><h3>Looking for more?</h3><p>We’ve created a satellite map fairly quickly here with POIs and road networks clearly visible, but if you’re looking for more to reference, we’ve got you covered.</p><p>Check out <a href="https://developer.tomtom.com/blog/build-different/manipulating-and-styling-map-layers-beyond-basics">this blog</a> on incorporating even more map layers to learn a little more about our other map styles and what you can display with other maps.</p><p>If you want to refer to a more basic how-to on setting up your vector map for the first time, <a href="https://developer.tomtom.com/maps-sdk-web-js/tutorials/basic/display-vector-map">take a look here</a>.</p><p>For more questions on this blog or on our new satellite imagery, message us in our <a href="https://devforum.tomtom.com/?_gl=1*1iagfym*_ga*MTAzNTkwNjgxNS4xNTY3NjE0Njk1*_ga_TFLCNKEXQ6*MTY1MzA3MjQ4Ni4zOTcuMS4xNjUzMDczNTk3LjA.">Dev Forum</a> or tag us on <a href="https://twitter.com/TomTomDevs">Twitter</a>.</p><p>Happy mapping!</p><p><em>This article was originally published at </em><a href="https://developer.tomtom.com/blog"><em>https://developer.tomtom.com/blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8980d127f36e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Developers can Accelerate Global Accessibility]]></title>
            <link>https://tomtomdevs.medium.com/how-developers-can-accelerate-global-accessibility-9dd70779ff97?source=rss-4d4fa75dc80------2</link>
            <guid isPermaLink="false">https://medium.com/p/9dd70779ff97</guid>
            <category><![CDATA[inclusion]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[TomTom Developers]]></dc:creator>
            <pubDate>Sun, 26 Jun 2022 23:36:20 GMT</pubDate>
            <atom:updated>2022-06-26T23:36:22.781Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M_ATDllRWpf--Lq8zCuxwQ.jpeg" /></figure><h3>What is Accessibility?</h3><p>Every user deserves a five-star digital experience online. People with disabilities must be able to experience web content and web-based services with the same successful outcome as those without disabilities. This awareness and commitment to equity and inclusion is the goal of <a href="https://accessibility.day/">Global Accessibility Awareness Day</a> (GAAD), a global event that shines a light on digital access and inclusion for people with disabilities.</p><p>Accessibility can be understood as the ability to access and benefit from a system or entity. This concept focuses on enabling access for people with disabilities, but research and development in accessibility can benefit everyone. This is known as the the curb-cut effect: Designs created to benefit people with disabilities often end up benefiting a much larger user group. A few examples include:</p><ul><li>Curb cuts in sidewalks were originally designed for wheelchairs — but they also help people with strollers, bikes, scooters, and more.</li><li>Closed captioning on video material was originally for people with hearing impairments — but they also help people watching videos in noisy or silent environments, or foreign/international viewers.</li><li>The typewriter was originally invented to help the blind write, but became the standard method of written communication for all.</li></ul><h3>Why Accessibility Matters</h3><p>Developers are uniquely positioned to play a large role in increasing and expediting accessibility globally in the designs of websites and apps — according to AccesiBe, around 2.3% of the US population needs some sort of assistance to access the Web. Not included in that number might be those who have not reported their impairments in surveys, or fall along a spectrum which might still benefit from mindful, adaptive design elements.</p><p>Some of the causes of the most common accessibility failures are low contrast text, missing image alt text, empty links, missing form input labels, empty buttons, and missing document language. Many of these fixed also elevate the development quality of a website, and are easily corrected to help support a better user experience for all web users.</p><h3>Visual Access</h3><p>Optimizing web content for varying visual abilities might take a combined approach — those with color vision deficiency might benefit from design which <a href="https://developer.tomtom.com/blog/spotlight/map-accessibility-how-customize-your-map-color-blindness">utilizes accessible color schemes</a>, and relies less on differentiating between monochromatic shades.</p><p>Providing a better experience for those with low vision or those with other visual impairments means incorporating shapes, color and text together to emphasize meaning and direction, as well as keeping content in a straightforward, simple visual layout, with one alignment justification. Just like for color vision differences, using high contrast, readable text formats can greatly improve visual access for all body text and section headlines.</p><p>Improving the visual layout of text, while working to keep phrasings and overall experience short and concise, not only benefits visual needs but other accessibility areas as well.</p><h3>Improving Access for Mobility, Hearing impairments, and Screen Reader users</h3><p>When we think of “accessible” when referring to web content, we often follow it with the word “design”, which is often inherently interpreted as visual for sighted individuals. The reality is that many adaptive or assistive technologies rely on clear layouts and organization of the page elements for screen readers, closed captioning tools, and keyboard and touchscreen use.</p><p>Pages with extra wide formats can be cumbersome to navigate, especially when right margins are not fixed. This means that while text to speech technology might read text without issue, someone who wishes to read along or look at graphical elements will have to scroll both horizontally and vertically, likely experiencing lag. For those using mobility aids, this creates extra steps to navigate a page and can be a barrier to a good digital experience.</p><p>Clean use of HTML5 elements makes it easier for web applications to adapt to outside tools. Subheadings created only with visuals such as text size and physical screen placement in mind might not come across clearly with screen reading technology, where they can otherwise be adapted for their intended use. Smart use of these section dividers give meaning, emphasis and direction to page content which can also speak to neural/cognitive differences, helping to reinforce understanding of main points.</p><p>Lastly, transcription is growing in ease of integration and awareness on many platforms, such as TikTok, YouTube and through content creators themselves making an effort to create inclusive content for their entire following. Developers do well to hop on this wagon of including captions within videos, and providing image descriptions which can be read with text-to speech tools.</p><h3>Learn More</h3><p>Developers have the opportunity to optimize web apps for better visual, hearing, and mobility access — and many best practices cross over from area to area to help easily reach even more individuals who can benefit from adapted design practices.</p><p>To get started on our developer portal, <a href="http://developer.tomtom.com/">register for a free account</a> to get your free API key.</p><p>Have some thoughts on what design practices you’d like to see in the world of mapping? Tag us on <a href="http://twitter.com/tomtomdevs">Twitter</a>, or ask us a question in our <a href="http://devforum.tomtom.com/">Forum</a>.</p><p><em>This article was originally published at </em><a href="https://developer.tomtom.com/blog"><em>https://developer.tomtom.com/blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dd70779ff97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Meet the Women Mapping the World: Part 2]]></title>
            <link>https://tomtomdevs.medium.com/meet-the-women-mapping-the-world-part-2-a95939752517?source=rss-4d4fa75dc80------2</link>
            <guid isPermaLink="false">https://medium.com/p/a95939752517</guid>
            <category><![CDATA[mapping]]></category>
            <category><![CDATA[geospatial]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[location]]></category>
            <dc:creator><![CDATA[TomTom Developers]]></dc:creator>
            <pubDate>Sun, 19 Jun 2022 03:39:52 GMT</pubDate>
            <atom:updated>2022-06-19T03:39:52.441Z</atom:updated>
            <content:encoded><![CDATA[<p>Celebrating International Women’s Day at TomTom Developers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UZ4QEp2aXeqBhO4HNzC0lw.jpeg" /></figure><p>To celebrate International Women’s Day this year, we’re highlighting women who are doing awesome things in the GIS and geospatial space in a two-part blog series. This is part 2 in the series — <a href="https://developer.tomtom.com/blog/spotlight/meet-women-mapping-world-part-1">you can check out part 1 here</a>.</p><p>As Women’s History Month winds down, we’re wrapping up the month by highlighting four more inspirational women who are working in GIS to disrupt industries and make geospatial data and tools more accessible to all. Keep reading to hear their stories.</p><h3>Meet the Women, Part 2</h3><h3>Bonny McClain, GIS &amp; Spatial Data Analyst</h3><p><em>North Carolina, USA</em></p><p>Bonny is a spatial data analyst and author of Python for Geospatial Data Analysis currently available in early release. As a member of the National Press Club, 500 Women Scientists, and URISA, Bonny applies advanced data analytics to discussions of how the built infrastructure influences outcomes of disparity and inequity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/0*I4LreDAfxRcij49J.jpg" /></figure><p><strong>How did you get into geospatial?</strong></p><p>My graduate thesis examined the geomorphic tropic hypothesis linking species location to landscape characteristics. By exploring the constraints of landscape patterns on fish mobility and ecological genetics in arctic watersheds I became interested in population genetics. Leaving bench science behind in favor of technical writing in the medical and data science fields, I created narratives focused on the built infrastructure to inform people about structural determinants of health, and both racial and gender inequity.</p><p>To truly bring history to light we need to bring the right data into the conversation, use the right tools, and be able to hold a tension between what we would like the solutions to be and what limits the actual realization of change.</p><p><strong>How would you like to see the future of mapping evolve?</strong></p><p>I don’t think it should be a separate skillset. We need to integrate location intelligence and geospatial skills into data science. People don’t care about the tool, they care about the story — and they care if you compelled them to think deeply about something and to care about something.</p><p>Data storytelling has never been more popular. Immanuel Kant stated the following in 1802, “The history of occurrences at different times, which is true history, is nothing other than a consecutive geography, and thus it is a great limitation on history if one does not know where something happened, or what it was like.”</p><p><em>Bonny is a 2022 SciPy Diversity Committee Chair and a featured speaker at GeoPython 2022 in Basel, Switzerland. To learn more about Bonny’s work, you can check out her blog, </em><a href="https://datadonuts.weebly.com/"><em>data &amp; donuts</em></a><em>, which explores the cornerstone of policy, data, and healthcare, her </em><a href="https://datamongerbonny.substack.com/"><em>mumble|delegate|ponder newsletter</em></a><em> on Substack, and her weekly geospatial connections chats on Twitter Spaces, Wednesdays at 1 PM ET.</em></p><h3>Julija Babre, Senior Product Marketing Manager, Maps APIs, TomTom</h3><p><em>Amsterdam, The Netherlands</em></p><p>Julija is a senior product marketing manager at TomTom whose role entails understanding the developer audience — what they’re trying to achieve, what products they need, and what support they need to build successful apps with location tech.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*FMw9ImJTaFTz0lSH.jpg" /></figure><p><strong>How did you get to where you are today?</strong> I started my career as a business concept developer and a product owner in the R&amp;D department of a multinational lighting company. I worked in multidisciplinary teams to understand customer needs, define new value propositions, build and validate prototypes and concepts of products and services. I really enjoyed doing that as it allowed me to engage with customers and translate their (future) needs into products and services. No location tech there though. I discovered and fell in love with maps in my next career step.</p><p>When an opportunity to join TomTom’s rapidly growing developer relations team came up, I was really grateful to be able to join! Since then, it’s been steep learning curve and many adventures in one-of-a-kind-great TomTom culture. I find it very exciting how much impact location technology can have on daily activities of many businesses. And that’s only the beginning — the future is looking really exciting from where we are standing.</p><p>As I reflect on my career in the context of women’s history month blog series, I also see that in every step of my career path I had the luck to have strong, intelligent and inspiring women and men around me who not only achieved great career heights themselves, but who also valued and promoted diversity and growth of their colleagues in whichever team they worked in. Thank you, colleagues!</p><p><strong>What does the future of mapping look like to you?</strong></p><p>As things become more and more connected, location tech and its accessibility to developers of all experience levels is growing in importance. Currently, a vast amount of developers work with Maps APIs already as many mobile and web apps use location tech in one way or another — from simply adding a beautiful map display, to providing a parcel courier with the best route and their customer with a reliable ETA.</p><p>With that in mind, for me the key is the quality of map data and services, ease of access, and easy use for devs of any experience level. And, with Maps APIs that are supported by increasingly great developer experience, adding location tech into an app is becoming increasingly accessible.</p><h3>Esther Onyekachi Ogbu</h3><p><em>England</em></p><p>Esther is Deputy Director of Strategy &amp; Business Development at Sambus Geospatial Limited, as well as the Co-founder of Geoluminous, Co. Ltd. — a startup with a mission to drive tech innovation and creativity in the geospatial industry through digital and non-digital products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/0*CFhA0gRW4cYhKG6D.jpg" /></figure><p>**What was a career-defining moment for you? **</p><p>I’d always wanted to make a career in geospatial after I first encountered GIS in my undergrad, where I studied Surveying and GeoInformatics. However, right after graduation I got a job in project management &amp; corporate events. Within three short years, I had climbed the ladder rather quickly, but I still wanted to explore and satisfy my geospatial career curiosity as doing short courses in GIS during my spare time was not enough.</p><p>In 2018, I decided to resign from my job and make a plan to pivot back into GIS. In 2019, I got a job with the Esri Distributor for West Africa, moved cities and away from my family, and it’s been quite uphill from there, with of course, the usual challenges.</p><p><strong>How can we grow the field of GIS with more women in mind?</strong></p><p>Access and awareness to the industry needs to be made available and encouraged from an early stage for women and girls. Also, the increasing consciousness of diversity and inclusion in the geospatial industry plays a significant role, as will the visibility of more women in top-ranked categories/lists as well as on speaking panels encourage others that there are numerous opportunities for them. This is improving with the various geospatial communities around the world set up for women to foster growth, relationships and give them a safe space to learn from one another.</p><p>Personally, I am a member of African Women in GIS as well as the Women+ in Geospatial, and these communities have had a significant impact on my career and contribution within the industry. Recently, I co-founded a company — Geoluminous Co. Ltd, which has a non-profit arm (The GIS Girl) that plans to train girls and women with GIS knowledge and skills to position them to enter into the industry.</p><p><em>You can learn more about Geoluminous here: </em><a href="https://geoluminous.co.uk/"><em>https://geoluminous.co.uk</em></a></p><h3>Galyna Uvarova, GIS &amp; Data Officer, Green Climate Fund</h3><p><em>Incheon, South Korea</em></p><p>Originally from Ukraine and now hailing from South Korea, Galyna focuses on providing data-driven evidence for evaluating the operations of the Green Climate Fund. She also works on international projects with an NGO, striving to make communities into better places to live.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/0*8iq35W1bUXZFawGC.jpg" /></figure><p>**Can you share a little about your career path? How did you get to where you are today? **</p><p>Like many GIS professionals in Ukraine, I started my career in the IT industry. I worked in the field of navigation in my first job. Outside of my technical career, I have coordinated international projects with an NGO, striving to make communities into better places to live. Such a split between the private sector and non-profit projects persisted for several years and became stressful; I was looking for a way to use my technical expertise to make better decisions.</p><p>I obtained a second Master’s degree in Economics and Environment and dedicated my geospatial skills to climate action and humanitarian response. I’m now based out of South Korea. Having experience across different levels and domains has become my strength and adds value to my teams.</p><p>**What does the future of mapping look like to you? **</p><p>Currently, we are swimming in the sea of real-time data and poor analytics. I’d say there are three critical directions for mapping that will enable us to deal with the post-truth era when someone’s personal opinion and a quick graph have substantial influence.</p><p>First, we need to focus on the ease of geospatial data exploration. We need to continue promising developments of the recent years until exploring GIS data for any socioeconomic or climate variable will become as easy as performing an online search.</p><p>Second, we need to revive the art of creating high-quality maps. Until now, the mapping industry focused on lowering the entry barrier for beginners. As a result, everyone can produce a map — and only a minority continuously works on their mapping skills, and we get many maps that distort or misrepresent data. As a community, we have to raise standards for the maps that are shared and used publicly. I’d love to revive the map atlas era, where it takes a long time to develop high-quality, beautiful maps — and these maps are referenced and valid for a long time.</p><p>The third is the GIS literacy among decision-makers. Only a few are aware of the potential of mapping beyond choropleth. The decision-makers play a crucial role in enabling their team to leverage and diversify mapping tools. We should find a pathway to bring mapping closer to their minds and hearts.</p><h3>Next Steps</h3><p>To learn more about what opportunities we have at TomTom, check out the links below:</p><ul><li><a href="https://www.tomtom.com/careers/">Career page</a></li><li><a href="https://www.tomtom.com/careers/diversity-and-inclusion/">Diversity &amp; inclusion at TomTom</a></li></ul><p>To explore other mapping, GIS, and tech communities committed to diversity and representation, check these organizations out:</p><ul><li><a href="https://sites.google.com/view/women-in-geospatial/home%E2%80%AF%E2%80%AF%20">Women+ in Geospatial</a> — A professional network to promote gender equality in the geospatial industry &amp; academia</li><li>Subreddit <a href="https://www.reddit.com/r/girlsgonewired/">r/girlsgonewired</a> — an online community of over 20K women in tech with discussions on career advice and more. — <a href="https://www.reddit.com/r/girlsgonewired/%E2%80%AF">https://www.reddit.com/r/girlsgonewired/</a></li><li><a href="https://bgmapp.org/">Black Girls M.A.P.P.</a> — Celebrating &amp; connecting marginalized communities; using GIS to investigate social issues &amp; empower change. — <a href="https://bgmapp.org%20/">https://bgmapp.org</a></li><li><a href="https://geolatinas.weebly.com%20/">GeoLatinas</a> — Embracing, empowering, and inspiring Latinas to pursue and thrive in careers in Earth and Planetary Sciences. — <a href="https://geolatinas.weebly.com%20/">https://geolatinas.weebly.com</a></li><li><a href="https://gisnorthstar.org/">NorthStar of GIS</a> — A community group working to increase representation, belonging, and inclusion of people of African descent in GIS. <a href="https://gisnorthstar.org%20/">https://gisnorthstar.org</a></li><li><a href="https://africanwomeningis.org/">African Women in GIS</a> — an online community that gives African women the freedom to create connections, gain mentors, learn new skills, access courses, and get job-related advice and opportunities. <a href="https://africanwomeningis.org%20%20/">https://africanwomeningis.org</a></li></ul><p>Did we miss any communities? Share your favorites on Reddit at r/tomtom or the <a href="http://devforum.tomtom.com/">TomTom Developer Forum</a>.</p><p><em>This article was originally published at developer.tomtom.com/blog.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a95939752517" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Visualizing TomTom Traffic Index Data with Data Science Tools]]></title>
            <link>https://tomtomdevs.medium.com/visualizing-tomtom-traffic-index-data-with-data-science-tools-2fc353b336b4?source=rss-4d4fa75dc80------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fc353b336b4</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[TomTom Developers]]></dc:creator>
            <pubDate>Mon, 13 Jun 2022 19:51:46 GMT</pubDate>
            <atom:updated>2022-06-13T19:51:46.411Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IAKKNcCeFrkGCHhmdJgY6g.jpeg" /></figure><p>Billions of cars travel through the streets, each generating a constant stream of data. Studying this information requires data science, which has become a crucial part of any automotive application. Whether building a mobile app or web application, developers need a solid understanding of data science tools to conceptualize, visualize, and maximize the potential of their data.</p><p>As TomTom provides all of the data your application requires, it enables you to step back and view the bigger picture. Suddenly, you can understand how this data connects globally, discover patterns affecting businesses and daily life, and discover how enormous segments of the public are adjusting to the post-pandemic “new normal.”</p><p>In this article, we’ll discuss some insights from the 2021 TomTom Traffic Index Report. Then, we’ll explore how to use data science tools to visualize the gathered data. While the report contains a wealth of information, we’ll focus primarily on day-to-day traffic variations, seeking the best day and time to travel from San Francisco.</p><p>To follow this tutorial, you should have some familiarity with Python. We’ll explain how to use data science tools like NumPy and Seaborn.</p><h3>TomTom’s 2021 Traffic Index Report</h3><p>TomTom’s yearly <a href="https://www.tomtom.com/en_us/traffic-index/ranking/">Traffic Index</a> report highlights new trends in traffic globally and locally, serving as a powerful tool to analyze and understand its patterns.</p><p>As the pandemic has shifted, many have wondered whether the public has returned to some degree of normalcy. This year’s report tries to answer this question by comparing roadway congestion levels from 2019, 2020, and 2021. Additionally, the 2021 report includes emissions data related to congestion.</p><p>In 2021, Istanbul was the world’s most congested city, with a congestion level of 62 percent. Congestion had increased by 11 percent from the previous year.</p><p>The second most congested city was Moscow, at 61 percent. This is 7 percent higher than in 2020. Meanwhile, Mecca was the least traffic-congested city at maintaining its 7 percent rate from 2020.</p><p>This report enables you to search for traffic information in your city, including live traffic information, congestion levels, and congestion figures by time of day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/0*ZCKHWkZH7WOlY7si.jpg" /></figure><p>After looking at the Traffic Index report, you’re probably eager to do something similar in your own data science projects. First, it is crucial to visualize the data and identify any patterns before implementing an algorithm. So, let’s explore how to use TomTom’s traffic APIs and corresponding data science tools.</p><h3>Using Traffic APIs</h3><p>TomTom’s wide variety of APIs makes retrieving data straightforward. Whether you need to find traffic routing data or a specific location, you can find the necessary tools within the <a href="https://developer.tomtom.com/docs-and-tools">TomTom API documentation</a>. If you don’t already have a TomTom account, <a href="https://developer.tomtom.com/user/register">register your Freemium account</a> enabling thousands of free requests daily. Then pay as you grow.</p><p>The following code demonstrates how to use Traffic APIs to generate a simple diagram similar to that in the 2021 report. To follow <a href="https://developermedia.sharepoint.com/:u:/s/ContentLabIO/Ec2x5vatSQRDtLkFiAfynk0Bi1AcTCcrga0Czfi36f-A7Q?e=Ax8nfW">this example</a>, create a Jupyter notebook and add the following code.</p><p>Since we need to perform HTTP requests in Python to communicate with TomTom APIs, we need to first import Python’s <a href="https://docs.python-requests.org/en/latest/">requests library</a>. Using your favorite editor, import these libraries with this command:</p><pre>import requests</pre><p>The requests library enables sending HTTP requests. In our case, we just need to specify the API to request. <a href="https://developer.tomtom.com/routing-api/api-explorer">API explorer</a> helps with the parameters, as seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*W0Aef6rAxcPSd_Ex.jpg" /></figure><p>Assemble the request parameters and call the requests.get(URL) to get a response from TomTom servers:</p><pre># Create request URL<br>API_params = (urlparse.quote(start) + &quot;:&quot; + urlparse.quote(end) <br>+ &quot;/json?departAt=&quot; + urlparse.quote(departure_time_2021))<br>request_url2021 = base_url + API_params + &quot;&amp;key=&quot; + yourkey<br># Get data<br>response2021 = requests.get(request_url2021)</pre><h3>Saving Data</h3><p>After requesting data from TomTom, it’s good practice to save it in CSV format. This approach reduces the number of requests to the TomTom server.</p><p>Python provides the to_csv() method to save data frames in this format. To use this method, simply call it from the data frame you need to save:</p><pre># saving dataframe into CSV file<br>df2021_daily.to_csv(&#39;df2021_daily_hourly_6AM.csv&#39;)</pre><h3>Importing Data</h3><p>If you need to load the data from the saved file in the next run, you can call the method read_csv(), which loads the CSV data into a data frame:</p><pre>df2021 = pd.read_csv(&quot;df2021_daily_monthly_6AM.csv&quot;)<br>df2021_daily = pd.read_csv(&quot;df2021_daily_hourly_6AM.csv&quot;)</pre><h3>Visualizing Data</h3><p>Data visualization converts the raw data into a visual representation to help us understand the nature of the data. You can use many visualization types including charts, tables, line graphs, and bar graphs. Furthermore, there are various visualization libraries and tools. We’ll explore the most common Python libraries for data visualization: Matplotlib, Seaborn, and NumPy. We’ll also introduce heatmaps.</p><p><strong>Madplotlib</strong></p><p><a href="https://matplotlib.org/stable/users/index.html">Matplotlib</a> is a library for two-dimensional illustrations in Python. It supports many visualization types, including basic bar, line, and scatter plots. It also supports statistical plots and unstructured coordinates. Import Matplotlib using this command:</p><pre>import matplotlib.pyplot as plt</pre><p><strong>Seaborn</strong></p><p>The <a href="https://seaborn.pydata.org/">Seaborn</a> library is based on Matplotlib and offers attractive statistical visualizations. Import Seaborn using this command:</p><pre>import seaborn as sns</pre><p><strong>NumPy</strong></p><p>If you want to work with arrays in Python, use the <a href="https://numpy.org/">NumPy</a> library. It’s equipped with linear algebra, matrices, and Fourier transform (FT). Import NumPy as follows:</p><pre>import numpy as np</pre><p><strong>Heatmap</strong></p><p>A heatmap is a colored representation of the data. When provided the data in a matrix format, the library converts it into attractive figures.</p><p>This article will use Seaborn heatmaps and Matplotlib to represent the traffic data.</p><h3>Examining Daily Traffic Changes</h3><p>As an example, we’ll use visualizations to display how traffic changes over the days of the week. We’ll request data for a single trip and compare the travel time at different start times each day of the week. Let’s visualize how trip times change each day between 6:00 AM and 5:00 PM on a journey from San Francisco. This information helps determine the best time of day to travel.</p><p>We can get the data using the <a href="https://developer.tomtom.com/routing-api/documentation/product-information/introduction">TomTom Routing API</a>. The API enables you to specify the starting point, destination, and departure time and uses historical data to estimate the trip time.</p><p>The following code iteratively changes the day and hour to collect the data from TomTom Routing APIs over each day of the week:</p><pre>date = datetime.datetime(2021, 5, 1)<br>departure_time_start_2021 = datetime.datetime(date.year, date.month , date.day, 6, 0, 0)<br>day_range = range(0,7)<br>hour_range = range (0,12)<br>for i in day_range:<br>for j in hour_range:<br># Update the month<br>departure_time_2021 = departure_time_start_2021.replace(day=departure_time_start_2021.day + i, hour=departure_time_start_2021.hour +j)<br># Format datetime string<br>departure_time_2021 = departure_time_2021.strftime(&#39;%Y-%m-%dT%H:%M:%S&#39;) <br># Create request URL<br>request_params_2021 = (<br>urlparse.quote(start) + &quot;:&quot; + urlparse.quote(end) <br>+ &quot;/json?departAt=&quot; + urlparse.quote(departure_time_2021))<br>request_url_2021 = base_url + request_params_2021 + &quot;&amp;key=&quot; + key<br># Get data<br>response2021 = requests.get(request_url2021)<br># Convert to JSON<br>json_result_2021 = response2021.json()<br># Get summary<br>route_summary_2021 = json_result_2021[&#39;routes&#39;][0][&#39;summary&#39;]<br># Convert to data frame and append<br>if((i == 0) and (j==0)):<br>df_2021_daily = pd.json_normalize(route_summary_2021)<br>else:<br>df_2021_daily = df2021_daily.append(pd.json_normalize(route_summary_2021), ignore_index=True) <br>print(f&quot;Retrieving data: {i+1} / {len(day_range)}&quot;)</pre><p>The code stores the data in a data frame called df2021_daily. This frame holds the data in a linear format, but we need to reformat the data into a matrix format for the heatmap visualization. We’ll use NumPy to convert the data into a matrix.</p><p>First, we filter the required column from the data frame using this code:</p><pre>values = df2021_daily[&#39;travelTimeInSeconds&#39;]</pre><p>Next, we convert and copy the data into a NumPy array:</p><pre># Converting the dataframe into Numpy array<br>arr_daily = values.values.copy()</pre><p>Then, we resize the array into a two-dimensional array (matrix) containing data shaped for seven 12-hour days:</p><pre># Reshaping the array into 2-dimension array features the days and month<br>arr_daily.resize(7, 12)</pre><p>The data is now ready for the HeatMap function to convert into a colored representation. Note that the data is now in a matrix of size (7,12). We need to transpose it into a matrix with the shape (12,7). So, you’ll see that the code calls a transpose function while passing data to the heatmap:</p><pre># configuring the size of the plot<br>ax = plt.subplots(figsize=(11, 9))</pre><p>As we generate the heatmap using the Seaborn heatmap function, we use the coolwarm colormap to represent low numbers in blue and increase the degree of red as the warm numbers increase:</p><pre># generating heatmap for the data<br># we used transpose to define the display orientation<br>ax = sns.heatmap(np.transpose(arr_daily) , linewidth = 1, cmap = &#39;coolwarm&#39; )</pre><p>We now define the Y-axes’ labels for better visualization:</p><pre># yticks defines the Y-axes&#39; labels<br>yticks_labels = [&#39;6AM&#39;, &#39;7AM&#39;, &#39;8AM&#39;, &#39;9AM&#39;, &#39;10AM&#39;, &#39;11AM&#39;,<br>              &#39;12PM&#39;, &#39;1PM&#39;, &#39;2PM&#39;, &#39;3PM&#39;, &#39;4PM&#39;, &#39;5PM&#39;]</pre><pre>plt.yticks(np.arange(12) + .5, labels=yticks_labels)</pre><p>Finally, we define the graph title:</p><pre># defining the title of the HeatMap<br>plt.title( &quot;Traffic over the day&quot;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/0*4hVbF0TTN-GQtuem.jpg" /></figure><p>The resulting heatmap provides some interesting traffic insights. For example, the worst time to travel was on Thursday at 4 PM. The best time was between 6 AM and 2 PM every day, except Sunday. We can use this information to help our application users find the most convenient time to drive from San Francisco.</p><p>We can use the same steps to generate heatmaps for previous years and compare the results to identify long-term changes in traffic behavior. We only need to change the start date to the corresponding days in 2020 by modifying the following lines:</p><pre>date = datetime.datetime(2020, 5, 2)</pre><p>The newly generated heatmap will appear similar to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*rFjsXeFtJ9L0X2iJ.jpg" /></figure><p>When comparing the two heatmaps, we can observe mostly consistent traffic behavior between 2020 and 2021. In both years, the roads become busy after 3 PM on most days. However, the traffic density shifts somewhat between the two years. Additionally, the comparison shows that in 2020, there was more traffic on Friday mornings and throughout each Saturday.</p><p>We can repeat this process for any day in the year. TomTom also enables us to show predictions for the next year using TomTom Routing APIs with future days.</p><h3>Next Steps</h3><p>It’s easy to extract traffic information from TomTom APIs like the Traffic Index 2021. You just need to know how to use this data in your application. Data science tools like Matplotlib, NumPy, Seaborn, and heatmaps help delve into TomTom’s vast amounts of information to find helpful insights for theoretical study and practical planning.</p><p>Insights like this can help drivers plan a road trip and help companies transport goods between cities. Other insights might help realtors rate the least polluted city based on vehicle emissions or help car manufacturers target their next market.</p><p><strong>Explore the </strong><a href="https://www.tomtom.com/en_gb/traffic-index/ranking/"><strong>TomTom Traffic Index</strong></a><strong> to find data to help your own projects.</strong> Then follow this tutorial’s steps to visualize data and glean insights for your applications.</p><p><em>This article was originally published at developer.tomtom.com/blog.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fc353b336b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding Advanced TomTom Mapping Features to a Modern Vue + Quasar App]]></title>
            <link>https://blog.devgenius.io/adding-advanced-tomtom-mapping-features-to-a-modern-vue-quasar-app-97268f3f49c2?source=rss-4d4fa75dc80------2</link>
            <guid isPermaLink="false">https://medium.com/p/97268f3f49c2</guid>
            <category><![CDATA[sdk]]></category>
            <category><![CDATA[quasarframework]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[TomTom Developers]]></dc:creator>
            <pubDate>Tue, 24 May 2022 13:53:23 GMT</pubDate>
            <atom:updated>2022-05-25T07:11:10.313Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn how to add a search function, then use Calculate Route to calculate and display a map route</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DJvh8Nuo-Y2BjBFVMthtlA.jpeg" /></figure><p>Geolocation-based applications help users find locations, keep track of places, and visualize these locations on a map. TomTom Maps API and SDK have made it easier for developers to build these web applications with various mapping services accessible on different devices.</p><p>In this tutorial, we&#39;ll build a Quasar application to help users search and track the route to a particular location. We&#39;ll use TomTom’s Search API, Routing API, and Matrix Routing Service.</p><p>You should be familiar with JavaScript and Vue, but you don’t need Quasar experience to follow this tutorial. Feel free to check out our other article, <a href="https://developer.tomtom.com/blog/build-different/adding-tomtom-maps-vue-quasar-app">Adding TomTom Maps to a Vue + Quasar App.</a></p><h3>PREREQUISITES</h3><p>First, ensure Node is on your local development machine. Check if you have it by running this command in your terminal:</p><pre>node –v</pre><p>If you don’t have Node, <a href="https://nodejs.org/en/download/">download it</a>. Also, <a href="https://quasar.dev/start/quasar-cli">install the Quasar CLI</a> if you don’t already have it.</p><p>You’ll also need a <a href="https://developer.tomtom.com/user/register">TomTom developer account</a>. You get thousands of <a href="https://developer.tomtom.com/store/maps-api">free requests</a> daily, even for commercial applications. Just pay as you grow!</p><h3>SETTING UP THE PROJECT</h3><p>We’ll set up the Quasar application. First, create a new Vue project using the Quasar CLI:</p><pre>quasar create route-tracker</pre><p>This command creates a prompt for you to add details about the project and the suitable development environment. Once the application is successfully created, the Quasar CLI displays the command to change into the newly-created directory. Run this command to start your application:</p><pre>quasar dev</pre><p>The result should look like this:</p><p>Next, we set up TomTom in our application by installing the required Map SDKs and APIs. So, we’ll install TomTom’s services:</p><pre>npm install @tomtom-international/web-sdk-maps @tomtom-international/web-sdk-services</pre><p>Then, install the Maps SDK:</p><pre>npm i @tomtom-international/web-sdk-maps</pre><p>You will need to use your TomTom API key in this project. <a href="https://developer.tomtom.com/how-to-get-tomtom-api-key">Here&#39;s</a> a simple guide to create one for free — no credit card required.</p><h3>CREATING THE LAYOUT</h3><p>The application layout includes a search bar to search for places, a map container to display the map, and the results, which display the calculated distance and time respectively. This image demonstrates the UI layout:</p><p>Add this code to the template section of the MainLayout file:</p><pre>&lt;q-layout view=&quot;lHh Lpr lFf&quot;&gt;<br>    &lt;q-header elevated&gt;<br>      &lt;q-toolbar class=&quot;bg-deep-purple-8  text-white&quot;&gt;<br>        &lt;q-toolbar-title &gt;<br>          Route Tracker<br>        &lt;/q-toolbar-title&gt;<br>      &lt;/q-toolbar&gt;<br>    &lt;/q-header&gt;<br>     &lt;q-page-container&gt;<br>     &lt;!-- To handle the search for location --&gt;<br>      &lt;div class=&quot;q-pa-md&quot; &gt;<br>    &lt;q-form  class=&quot;q-gutter-md&quot; &gt;<br>      &lt;q-input filled v-model=&quot;locationQuery&quot; label=&quot;Search for an address/location&quot;/&gt;<br>      &lt;div&gt;<br>        &lt;q-btn label=&quot;Search&quot; type=&quot;submit&quot; color=&quot;deep-purple-8&quot;/&gt;<br>      &lt;/div&gt;<br>    &lt;/q-form&gt;<br>    &lt;div&gt;<br>    &lt;!-- To display the result--&gt;<br>      &lt;p&gt;Destination -  {{routeAddress}} &lt;/p&gt;<br>      &lt;p&gt; Estimated Route Distance(KM) - {{destinationDistance}}<br>        &lt;br&gt;<br>           Estimated Time(MINS) -  {{timeToDestination}}<br>      &lt;/p&gt;<br>      &lt;p&gt;<br>        {{errorMessage}}<br>      &lt;/p&gt;<br>    &lt;/div&gt;<br>    &lt;/div&gt;<br>    &lt;/q-page-container&gt;<br>  &lt;/q-layout&gt;</pre><p>This code creates the application’s user interface (UI) layout.</p><h3>DISPLAYING A MAP</h3><p>TomTom Maps APIs enable us to display maps in the application. We can also style our maps to our liking.</p><p>Index.template.html, include the CSS stylesheet to handle the maps:</p><pre>&lt;link rel=&#39;stylesheet&#39; type=&#39;text/css&#39; href=&#39;https://api.tomtom.com/maps-sdk-for-web/cdn/6.x/6.13.0/maps/maps.css&#39;&gt;</pre><p>Also, import the tt object the index.template.html in the Quasar application. This object represents the object library to access everything related to TomTom maps and services.</p><pre>import tt from &#39;@tomtom-international/web-sdk-maps&#39;</pre><p>We create a mapDisplay.vue file in the components folder to handle this section. This component will display the map in our application. Then, we add the map container layout to the mapDisplay.vue file:</p><pre>&lt;template&gt;<br>        &lt;div id=&#39;map&#39; class=&#39;window-height&#39;&gt;&lt;/div&gt;<br>&lt;/template&gt;</pre><p>Next, we create a function to display the map and add it to the mapDisplay.vue file:</p><pre>displayMap(){<br>            const map = tt.map({  <br>            key: &quot;8h504Wc4AXL6OPndqhrtKf70AovVBL3V&quot;,  <br>            container:&#39;map&#39;, // Container ID <br>            style: &#39;tomtom://vector/1/basic-main&#39;,  //the specified map style <br>        });  <br>        map.addControl(new tt.FullscreenControl());  <br>        map.addControl(new tt.NavigationControl()); <br>        const location = [this.longitude,this.latitude];<br>        const popupOffset = 25; <br>        const marker = new tt.Marker().setLngLat(location).addTo(map); <br>        const popup = new tt.Popup({ offset: popupOffset }).setHTML(&quot;Your Destination&quot;); <br>        marker.setPopup(popup).togglePopup();       <br>       }</pre><p>Then, we call the function to display the map in the mapDisplay.vue file using the mounted() lifecycle method:</p><pre>mounted() {  <br>        this.displayMap()<br>     }</pre><h3>INTEGRATING THE SEARCH API</h3><p>TomTom&#39;s Search API performs various functions such as fuzzy search, autocomplete, geocoding, and reverse geocoding.</p><h3>FUZZY SEARCH</h3><p>We’ll mainly focus on the fuzzy search, which searches for addresses and places like hospitals, bars, and restaurants. We can also restrict the search to a particular region or geometry.</p><p>The query’s result gives a detailed description of the location that matches the specific query text partially.</p><p>To implement fuzzy search, start by importing the tt object from the SDK in MainLayout.vue:</p><pre>import tt from &quot;@tomtom-international/web-sdk-services&quot;;</pre><p>Then, in MainLayout.vue, create the form to handle the search:</p><pre>&lt;div class=&quot;q-pa-md&quot; &gt;<br>    &lt;q-form @submit=&quot;SearchAndCalculateRoute()&quot; class=&quot;q-gutter-md&quot; &gt;<br>      &lt;q-input filled v-model=&quot;locationQuery&quot; label=&quot;Search for an address/location&quot;/&gt;<br>      &lt;div&gt;<br>        &lt;q-btn label=&quot;Search&quot; type=&quot;submit&quot; color=&quot;deep-purple-8&quot;/&gt;<br>      &lt;/div&gt;<br>    &lt;/q-form&gt;</pre><p>Next, create a function to handle the search:</p><pre>const _this = this<br>      // Using the fuzzySearch service<br>    await tt.services.fuzzySearch({<br>      key: &#39;INSERT API KEY HERE&#39;,<br>      query: this.locationQuery //The input gotten from the search<br>    }).then(function (response) {<br>      _this.routeAddress = response.results[0].address.freeformAddress<br>      _this.routeLatitude =  response.results[0].position.lat<br>      _this.routeLongitude = response.results[0].position.lng<br>    })</pre><p>This code performs the search function and displays the address’s first result while storing the latitude and longitude to use in the other services.</p><p>We can also add the bounding box parameter to refine the search. The bounding box is a limited area within the search results, and without it, the search considers the whole world. This parameter accepts longitude and latitude values of the place to search.</p><pre>&lt;!-- Display the result of the search --&gt;<br>&lt;p&gt; Destination -  {{routeAddress}} &lt;/p&gt;</pre><h3>POINT OF INTEREST SEARCH</h3><p>Another feature that we’ll add to our map is the ability to find specific places around the location searched for. We do this using Points of Interest Search, a service provided by TomTom that enables us to find a specific type of place, like restaurants, arts centers, or even transit stations.</p><p>We’ll implement this in the mapDisplay.vue file to display the places on the map. As an example, we’ll search for nearby gas stations. To implement fuzzy search, start by importing the tt object from the SDK in MainLayout.vue. The tts object is imported in the mapDisplay.vue:</p><pre>import tts from &quot;@tomtom-international/web-sdk-services&quot;;</pre><p>Then, a function is created to call the service when the map has been rendered on the page:</p><pre>tts.services.poiSearch({<br>            key: &#39;INSERT API KEY HERE&#39;<br>            query: Gas Stations,<br>            center: [ _this.latitude, _this.longitude ]<br>            })<br>            .then(function(data) {<br>              _this.stations = data.results})<br>              .catch((err) =&gt; {<br>                console.log(err)<br>            });</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97268f3f49c2" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/adding-advanced-tomtom-mapping-features-to-a-modern-vue-quasar-app-97268f3f49c2">Adding Advanced TomTom Mapping Features to a Modern Vue + Quasar App</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>