<?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" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ google maps - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ google maps - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Fri, 29 May 2026 23:04:35 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/google-maps/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Drop a Pin on Google Maps ]]>
                </title>
                <description>
                    <![CDATA[ If you want to save a new location you discovered on Google Maps, you need to drop a pin on that location.  In this article, I will show you how to drop a pin in Google Maps from your phone or computer. How to Drop a Pin on Google ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-drop-a-pin-on-google-maps/</link>
                <guid isPermaLink="false">66b8d981d482a18d3e028267</guid>
                
                    <category>
                        <![CDATA[ google maps ]]>
                    </category>
                
                    <category>
                        <![CDATA[ how-to ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Jessica Wilkins ]]>
                </dc:creator>
                <pubDate>Fri, 08 Oct 2021 19:03:55 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/10/henry-perks-BJXAxQ1L7dI-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you want to save a new location you discovered on Google Maps, you need to drop a pin on that location. </p>
<p>In this article, I will show you how to drop a pin in Google Maps from your phone or computer.</p>
<h2 id="heading-how-to-drop-a-pin-on-google-maps-mac-or-windows">How to Drop a Pin on Google Maps (Mac or Windows)</h2>
<p>Step 1: Sign into your Google Account</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-6.31.17-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Step 2: Click on the Google apps icon and go to Maps</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-9.41.51-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-6.32.11-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Step 3: Search for a location using the search bar </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-6.34.02-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Step 4: Click on the pin icon next to the location you want to save</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-6.35.35-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-9.43.14-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You should see a red pin icon on the location in the map.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-6.36.22-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-9.43.53-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-how-to-drop-a-pin-manually">How to drop a pin manually</h3>
<p>Go to any location on the map and click on the icon next to the location you want to save. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-6.38.28-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You should then see a red icon next to the location.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-6.38.56-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-how-to-save-the-location">How to save the location</h3>
<p>Once you pin a location, then click on save.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-9.54.40-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Then you can choose which list you want to save your pinned location to.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-9.55.11-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Then you should see it marked as saved. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-9.55.56-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>To find all of your saved locations, click on the menu icon and then click on Your Places. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-9.58.28-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-9.59.05-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Then you can click on the list where the location was saved to.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-10.00.10-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-how-to-share-a-location">How to share a location</h3>
<p>Click on the Share icon under the pinned location.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-10.17.32-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Then you can choose where to share your pinned location.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-10.18.25-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-how-to-remove-a-pin">How to remove a pin</h3>
<p>You can click on the <code>X</code> in the search bar.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-9.45.31-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-drop-a-pin-on-google-maps-phone">How to Drop a Pin on Google Maps (phone)</h2>
<p>If you haven't downloaded the Google Maps app on your phone you will need to do so. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_7EC548FE5DFA-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Step 1: Open the application and search for a location</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_34F953BEA7EF-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Step 2: Click on the location and you should see a red pin on the map</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-9.46.29-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-how-to-drop-a-pin-manually-1">How to drop a pin manually</h3>
<p>On the map, go to your location of choice and press and hold your finger down on that location.</p>
<p>You should then see a red pin appear next to the location. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-9.47.44-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>To save your location, scroll through the options and click on Save.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_3551A21D19C8-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Click on the list where you want to save it.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_974C885FBC14-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-how-to-share-your-pinned-location">How to share your pinned location</h3>
<p>You can find your pinned locations at the bottom of the app.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_1A73D60E475E-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Then click on the share icon at the top of the screen.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_70D52DCF175D-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Choose the method for sharing your pinned location.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_14A662267502-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-how-to-remove-a-pin-1">How to remove a pin</h3>
<p>To remove a pin, then you can click on the <code>x</code> in the search bar. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-08-at-9.48.18-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Anyone Can Map! Inspiration and an introduction to the world of mapping ]]>
                </title>
                <description>
                    <![CDATA[ Chef Gusteau was a visionary who created food experiences for the world to enjoy. How can we take his lessons and apply them to the world of mapping? Taking inspiration from a culinary great If you’ve seen the Pixar movie Ratatouille, you should know... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/anyone-can-map-inspiration-and-an-introduction-to-the-world-of-mapping/</link>
                <guid isPermaLink="false">66b8e31e47c23b7ae1ad0bd3</guid>
                
                    <category>
                        <![CDATA[ Data Science ]]>
                    </category>
                
                    <category>
                        <![CDATA[ google maps ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Heat map ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Inspiration ]]>
                    </category>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ leaflet ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Mapping ]]>
                    </category>
                
                    <category>
                        <![CDATA[ maps ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ react-leaflet ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ technology ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Colby Fayock ]]>
                </dc:creator>
                <pubDate>Thu, 05 Mar 2020 14:51:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/03/anyone-can-map.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Chef Gusteau was a visionary who created food experiences for the world to enjoy. How can we take his lessons and apply them to the world of mapping?</p>
<h2 id="heading-taking-inspiration-from-a-culinary-great">Taking inspiration from a culinary great</h2>
<p>If you’ve seen the <a target="_blank" href="https://www.pixar.com/">Pixar</a> movie <a target="_blank" href="https://movies.disney.com/ratatouille">Ratatouille</a>, you should know who <a target="_blank" href="https://ratatouille.fandom.com/wiki/Auguste_Gusteau">Chef Gusteau</a> is. He helped our “little chef” <a target="_blank" href="https://pixar.fandom.com/wiki/Remy">Remy</a> the rat navigate the culinary world and become the top chef of Paris.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/ratatouille-remy-chef-gusteau-paris.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Remy from Ratatouille overlooking Gusteau's in Paris</em></p>
<p>Throughout the movie, we get a lot of great quotes on their journey. But the one we're interested in here is Gusteau’s motto, and the title of his book, “Anyone can cook!” So how can we apply this and the lessons to our own mapping journey?</p>
<p>I’ll admit, part of the fun here was translating some of the lessons learned from one of my favorite movies, but there’s a lot to take in here. I'm going to walk through some examples and types of maps that should get you motivated to get started with your own mapping application. So let’s dive in!</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/pQ_5PGv0YTA" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h2 id="heading-get-inspired-by-learning-about-maps-and-the-impact-they-have-on-the-world">Get inspired by learning about maps and the impact they have on the world</h2>
<blockquote>
<p>Food always comes to those who love to cook. - Chef Gusteau</p>
</blockquote>
<p><a target="_blank" href="https://www.youtube.com/watch?v=a-1rcaQ-aSk&amp;list=PLeGxIOPLk9EKBu_B0WpBLYkkHQIGki2EZ&amp;index=3">Through my work</a>, I’ve found it easy to fall in love with working on maps. Every day, scientists use maps to visualize data that can assist them in making more effective decisions. This directly translates to benefitting people all around the world and saving lives.</p>
<p>With this inspiration, you'll be taken on a journey to learn more about the different types of maps in this world and how they’re being used. You even might stumble upon some interesting data that explores your own neighborhood!</p>
<h3 id="heading-active-fires-around-the-world">Active fires around the world</h3>
<p>Take for instance <a target="_blank" href="https://firms.modaps.eosdis.nasa.gov/map/">NASA’s FIRMS service</a>, which provides a realtime look at active fire data around the world.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/nasa-firms-active-fires-world.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Active fires around the world via <a target="_blank" href="https://earthdata.nasa.gov/earth-observation-data/near-real-time/firms">NASA FIRMS</a></em></p>
<p>Fires are a real-world example of disasters that we can learn from. This tool is used to help manage resources for stopping and preventing those fires by allowing scientists and those that are curious to analyze burn areas and model the data itself.</p>
<h3 id="heading-global-cases-of-covid-19">Global cases of COVID-19</h3>
<p>And something very current, cases of <a target="_blank" href="https://www.who.int/health-topics/coronavirus">COVID-19 (Coronavrius)</a> around the world by  <a target="_blank" href="https://systems.jhu.edu/">Johns Hopkins Center for Systems Science and Engineering</a>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/john-hopkins-coronavirus-map.jpg" alt="Image" width="600" height="400" loading="lazy">
<em><a target="_blank" href="https://www.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6">Global cases of Coronavirus (COVID-19) from John Hopkins CSSE</a></em></p>
<p>This map tracks the spread of the virus in real time, allowing scientists to model it's coverage and produce study results to share with the global community.</p>
<p>Mapping tools like this provide an effective means of giving as much information as possible in a way that’s easy to understand to the people who can make a difference with the information.</p>
<h3 id="heading-increased-life-expectancy">Increased life expectancy</h3>
<p>On a more positive note, we can get a detailed look over time of <a target="_blank" href="https://ourworldindata.org/life-expectancy">how life expectancy is improving around the world</a>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/life-expectancy-map.jpg" alt="Image" width="600" height="400" loading="lazy">
<em><a target="_blank" href="https://ourworldindata.org/life-expectancy">Life expectancy in 2019 from Our World in Data</a></em></p>
<p>While it’s increased more in some areas than others, the global improvements are clear, and we get to see this rise in some countries from hundreds of years ago!</p>
<h2 id="heading-explore-the-beauty-of-maps-and-applying-data-to-them">Explore the beauty of maps and applying data to them</h2>
<blockquote>
<p>How can I describe it? Good food is like music you can taste, color you can smell. There is excellence all around you. You need only to be aware to stop and savor it. - Chef Gusteau</p>
</blockquote>
<p>There’s also a creative side and beauty to great maps. Thick datasets applied to a map (or any medium) can often become literal works of art.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/pentagram-the-room-of-change.jpg" alt="Image" width="600" height="400" loading="lazy">
<em><a target="_blank" href="https://www.pentagram.com/work/the-room-of-change?rel=discipline&amp;rel-id=16">The Room of Change from Pentagram</a></em></p>
<p>Whether showcased in an exhibit or <a target="_blank" href="https://www.etsy.com/search?q=map">one of the many options to purchase on Etsy</a>, presenting meaningful data in a beautiful way can be impactful not just from an informational perspective, but also a cultural one.</p>
<h3 id="heading-sometimes-the-interactions-can-be-fun">Sometimes the interactions can be fun</h3>
<p>Maps can also provide some interactivity that makes them fun to explore while you learn more about the dataset, like this globe that maps out global commodities from DailyFX.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/dailyfx-global-commodities.jpg" alt="Image" width="600" height="400" loading="lazy">
<em><a target="_blank" href="https://www.dailyfx.com/research/global-commodities/globe">Global Commodities interactive map from DailyFX</a></em></p>
<p>Though the data can frequently be thick and boring on its own, that doesn’t mean we can't find more interesting ways to present the data to interact with.</p>
<h3 id="heading-and-sometimes-maps-can-provide-a-listening-experience">And sometimes maps can provide a listening experience</h3>
<p>This map from at <a target="_blank" href="http://radiooooo.com/">radiooooo.com</a> allows you to travel around the world and through time.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/radiooooo-music-radio-map.jpg" alt="Image" width="600" height="400" loading="lazy">
<em><a target="_blank" href="http://radiooooo.com/">Music Radio from radiooooo.com</a></em></p>
<p>Their use of a map makes it easy to identify the part of the world the person wants to explore.</p>
<h3 id="heading-stop-and-appreciate-the-maps-around-you">Stop and appreciate the maps around you</h3>
<p>Whether you notice it or not when you’re browsing the web every day, you most likely run into visualizations of datasets that create powerful ways to present that data in a way that’s more easily understood.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/reddit-truck-driver-map-dataisbeautiful.jpg" alt="Image" width="600" height="400" loading="lazy">
_<a target="_blank" href="https://www.reddit.com/r/dataisbeautiful/comments/csl706/i_recorded_my_travels_as_a_professional_truck/">u/dancingchopstix's recordings of their truck driving travels</a>_</p>
<p>Luckily, we don’t have to work hard to find this inspiration, as we can visit aggregations of beautiful maps and general datasets like that of <a target="_blank" href="https://www.reddit.com/r/dataisbeautiful/">/r/dataisbeautiful</a>.</p>
<h2 id="heading-experiment-be-creative-explore-other-ways-to-visualize-data">Experiment, be creative, explore other ways to visualize data</h2>
<blockquote>
<p>You must be imaginative, strong-hearted. You must try things that may not work, and you must not let anyone define your limits because of where you come from. Your only limit is your soul. - Chef Gusteau</p>
</blockquote>
<p>Maps come in all shapes and sizes. While shaded geographic areas typically work well with election results, it might not work as well for showcasing your summer road trip.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/50-state-project-road-strip.jpg" alt="Image" width="600" height="400" loading="lazy">
<em><a target="_blank" href="https://www.the50statesproject.com/">50 State Project road trip map</a></em></p>
<h3 id="heading-exploring-common-map-types">Exploring common map types</h3>
<p>You’ve probably experienced more map types than you realize. Given it’s a powerful way to present data, maps are used frequently across the web.</p>
<p>A <a target="_blank" href="https://en.wikipedia.org/wiki/Choropleth_map"><strong>choropleth map</strong></a> is commonly seen for election results and regional datasets where a particular geographic location represents a point of reference.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/cnn-democratic-primary-2020.jpg" alt="Image" width="600" height="400" loading="lazy">
<em><a target="_blank" href="https://www.cnn.com/election/2020/primaries-and-caucuses">CNN Map of Democratic primary after Super Tuesday</a></em></p>
<p><strong><a target="_blank" href="https://en.wikipedia.org/wiki/Heat_map">Heat maps</a></strong> on the other hand allow you to reflect on the intensity of a data point over a given area. This is powerful when you want to represent both the area covered of a dataset but also range the data represents at the same time, such as population density.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/arcgis-population-heatmap-2015.jpg" alt="Image" width="600" height="400" loading="lazy">
<em><a target="_blank" href="https://www.arcgis.com/home/webmap/viewer.html?useExisting=1&amp;layers=90978c3a3a664c20b8da8fc21de6071b">ArcGIS GPW 2015 Population Density heat map from</a></em></p>
<h3 id="heading-learn-from-others-but-dont-be-afraid-to-create-a-new-path">Learn from others, but don’t be afraid to create a new path</h3>
<p>Explore and play around with different techniques to visualize data on a map. There’s frequently not one way to do it, meaning you can be creative and experiment with different ways of presenting your map.</p>
<p>But that also means you don’t need to be stuck working within the constraints of the common map types. Use the tools available or create new ones and break new ground. The most important thing is presenting the data in a way that will provide the most impact to those consuming it.</p>
<h2 id="heading-dont-give-up-learn-from-your-experiences">Don’t give up, learn from your experiences</h2>
<blockquote>
<p>What I say is true — anyone can cook... but only the fearless can be great. - Chef Gusteau</p>
</blockquote>
<p>While there may not always be a right way, there <a target="_blank" href="https://twitter.com/TerribleMaps">sometimes are wrong ways</a>.  But don’t let failure stop you!</p>
<div class="embed-wrapper">
        <blockquote class="twitter-tweet">
          <a href="https://twitter.com/TerribleMaps/status/1119336763762331649"></a>
        </blockquote>
        <script defer="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></div>
<p>Take these failures as a learning experience in your journey of creating interesting and effective maps. By being bold with your experimentation, you’ll find yourself discovering techniques or creating new ways that can ultimately help people better understand map data.</p>
<h2 id="heading-you-dont-have-to-be-a-cartographer-to-build-great-maps">You don’t have to be a cartographer to build great maps</h2>
<blockquote>
<p>Not everyone can become a great artist; but a great artist can come from anywhere. - Anton Ego</p>
</blockquote>
<p>Towards the end of Remy’s journey, the food critic Anton Ego who was once critical of Gusteau's claim that “anyone can cook” came to a realization of what our chef truly meant.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/anton-ego-realization.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Ratatouille critic Anton Ego's revelation</em></p>
<p>While it’s not reasonable to assume that every single one of us will be a great mapper, everyone has the opportunity to try and explore the medium.</p>
<p>And it certainly helps that we have plenty of tooling to help us get there. Whether building your own with <a target="_blank" href="https://leafletjs.com/">Leaflet</a> or <a target="_blank" href="https://www.google.com/maps/about/mymaps/">identifying a few locations on a Google Map</a>, the resources and community around mapping are endless.</p>
<h2 id="heading-jump-in-with-some-resources-to-get-started">Jump in with some resources to get started</h2>
<p>For the developers out there who are inspired to get started, here are a few resources to start off with mapping:</p>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/easily-spin-up-a-mapping-app-in-react-with-leaflet/">How to build a mapping app in React the easy way with Leaflet</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/visualizing-air-pollution-folium-maps/">How to Visualize Air Pollution using Folium Maps - An In Depth Tutorial</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/how-to-integrate-maps-in-react-native-using-react-native-maps-5745490fe055/">How to integrate maps in React Native using react-native-maps</a></li>
<li><a target="_blank" href="https://www.colbyfayock.com/2020/03/how-to-create-a-coronavirus-covid-19-dashboard-map-app-with-gatsby-and-leaflet">How to create a Coronavirus (COVID-19) Dashboard &amp; Map App in React with Gatsby and Leaflet</a></li>
<li><a target="_blank" href="https://www.colbyfayock.com/2020/04/how-to-set-up-a-custom-mapbox-basemap-style-with-react-leaflet-and-leaflet-gatsby-starter/">How to set up a custom Mapbox basemap style with React Leaflet and Leaflet Gatsby Starter</a></li>
<li><a target="_blank" href="https://www.colbyfayock.com/2019/12/create-your-own-santa-tracker-with-gatsby-and-react-leaflet/">How to Create your own Santa Tracker with Gatsby and React Leaflet</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=a-1rcaQ-aSk&amp;list=PLeGxIOPLk9EKBu_B0WpBLYkkHQIGki2EZ&amp;index=3">Building Maps with Impact on React and the JAMstack</a> (Video)</li>
<li><a target="_blank" href="https://github.com/colbyfayock/gatsby-starter-leaflet">Gatsby Starter Leaflet</a></li>
<li><a target="_blank" href="https://leafletjs.com/">Leaflet</a></li>
<li><a target="_blank" href="https://openlayers.org/">OpenLayers</a></li>
<li><a target="_blank" href="https://www.google.com/maps/about/mymaps/">My Maps by Google</a></li>
</ul>
<h2 id="heading-whats-your-favorite-map-experience-or-tool">What’s your favorite map experience or tool?</h2>
<p><a target="_blank" href="https://twitter.com/colbyfayock">Share with me on Twitter!</a></p>
<div id="colbyfayock-author-card">
  <p>
    <a href="https://twitter.com/colbyfayock">
      <img src="https://res.cloudinary.com/fay/image/upload/w_2000,h_400,c_fill,q_auto,f_auto/w_1020,c_fit,co_rgb:007079,g_north_west,x_635,y_70,l_text:Source%20Sans%20Pro_64_line_spacing_-10_bold:Colby%20Fayock/w_1020,c_fit,co_rgb:383f43,g_west,x_635,y_6,l_text:Source%20Sans%20Pro_44_line_spacing_0_normal:Follow%20me%20for%20more%20JavaScript%252c%20UX%252c%20and%20other%20interesting%20things!/w_1020,c_fit,co_rgb:007079,g_south_west,x_635,y_70,l_text:Source%20Sans%20Pro_40_line_spacing_-10_semibold:colbyfayock.com/w_300,c_fit,co_rgb:7c848a,g_north_west,x_1725,y_68,l_text:Source%20Sans%20Pro_40_line_spacing_-10_normal:colbyfayock/w_300,c_fit,co_rgb:7c848a,g_north_west,x_1725,y_145,l_text:Source%20Sans%20Pro_40_line_spacing_-10_normal:colbyfayock/w_300,c_fit,co_rgb:7c848a,g_north_west,x_1725,y_222,l_text:Source%20Sans%20Pro_40_line_spacing_-10_normal:colbyfayock/w_300,c_fit,co_rgb:7c848a,g_north_west,x_1725,y_295,l_text:Source%20Sans%20Pro_40_line_spacing_-10_normal:colbyfayock/v1/social-footer-card" alt="Follow me for more Javascript, UX, and other interesting things!" width="2000" height="400" loading="lazy">
    </a>
  </p>
  <ul>
    <li>
      <a href="https://twitter.com/colbyfayock">? Follow Me On Twitter</a>
    </li>
    <li>
      <a href="https://youtube.com/colbyfayock">?️ Subscribe To My Youtube</a>
    </li>
    <li>
      <a href="https://www.colbyfayock.com/newsletter/">✉️ Sign Up For My Newsletter</a>
    </li>
  </ul>
</div>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Dropped Pins in Google Maps - How to Pin a Location and Remove a Pin ]]>
                </title>
                <description>
                    <![CDATA[ It's easy to tell a friend where to meet you if you're at a location with an actual address. But what if you're trying to find each other in a huge park? Or you're trying to give them directions to your super secret camping spot on that unnamed dirt ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/dropped-pins-in-google-maps-how-to-pin-a-location-and-remove-a-pin/</link>
                <guid isPermaLink="false">66b1fa1508bc664c3c097dd3</guid>
                
                    <category>
                        <![CDATA[ google maps ]]>
                    </category>
                
                    <category>
                        <![CDATA[ how-to ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Abigail Rennemeyer ]]>
                </dc:creator>
                <pubDate>Tue, 05 Nov 2019 19:08:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9f96740569d1a4ca4361.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>It's easy to tell a friend where to meet you if you're at a location with an actual address. But what if you're trying to find each other in a huge park? Or you're trying to give them directions to your super secret camping spot on that unnamed dirt road?</p>
<p>There's an easier way to do it than telling them to "turn left at the cow, after the big tree": dropping a pin in Google Maps.</p>
<h2 id="heading-what-does-this-mean">What does this mean?</h2>
<p>When you drop a pin in your exact location, you're saving the GPS coordinates of that spot. </p>
<p>That way, when you share it with your friend, you're telling them exactly where you are - not the nearest street address (which might be miles away).</p>
<h3 id="heading-so-how-do-you-do-it">So how do you do it?</h3>
<p>Let's go through the steps to add (and remove) a pin from Google Maps, both on your PC and your phone.</p>
<h2 id="heading-how-to-drop-a-pin-on-your-pc">How to drop a pin on your PC:</h2>
<h3 id="heading-step-1-open-your-favorite-browser-and-go-to-google-maps">Step 1: Open your favorite browser and go to Google Maps.</h3>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/Google-maps-pin-1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-step-2-get-to-a-more-specific-location">Step 2: Get to a more specific location</h3>
<p>In the "Search Google Maps" field, enter a more specific location so you can narrow down your search area.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/Google-maps-location.png" alt="Image" width="600" height="400" loading="lazy">
<em>Pick your starting point</em></p>
<p>Now you're getting closer. But still not close enough. The Barton Creek Greenbelt in Austin is a fairly large place. So zoom in a little.</p>
<h3 id="heading-step-3-drop-your-pin">Step 3: Drop your pin</h3>
<p>Once you're zoomed in, select the location you'd like to pin. Right-click, and then select "Directions to here" from the drop down that appears:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/Google-maps-directions-to-here.png" alt="Image" width="600" height="400" loading="lazy">
<em>Right click to drop that pin exactly where you are (or want to go)</em></p>
<p>It'll then ask you to enter a starting point (where's your friend coming from?) and will produce driving directions to that spot.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/Google-maps-pin-directions.png" alt="Image" width="600" height="400" loading="lazy">
<em>Getting directions</em></p>
<h3 id="heading-step-4-share-your-directions">Step 4: Share your directions</h3>
<p>Now you just have to tell your friend where to go - so you'll want to share those directions.</p>
<p>Click the hamburger menu (three horizontal bars) in the upper left, and select "Share or embed maps" from the long dropdown list.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/Google-maps-share-map.png" alt="Image" width="600" height="400" loading="lazy">
<em>Share 'em with a friend</em></p>
<p>You'll have the option to share the link via social media or, if you'd like to keep it private, to copy the link and send it directly to your friend:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/Google-maps-share-map-link.png" alt="Image" width="600" height="400" loading="lazy">
<em>Or share 'em with everyone (only if you want the world to know where you are)</em></p>
<p>There you go! Your friend will have a much better chance of finding you now.</p>
<h3 id="heading-how-to-remove-the-pin">How to remove the pin</h3>
<p>If you want to remove the pin from Google Maps, simply right click on it and select "Remove this destination." Poof, it's gone.</p>
<h2 id="heading-how-to-drop-a-pin-on-your-phone">How to drop a pin on your phone</h2>
<p>It's super easy to drop a pin on your iPhone. Simply open the Google Maps app and navigate to the general area where you are/want to be.</p>
<h3 id="heading-step-1-find-your-spot">Step 1: Find your spot</h3>
<p>Zoom in, like we did above, until you can see the spot you'd like to pin. Then just press and hold on the screen until that little red pin drops:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/Google-maps-dropped-pin.png" alt="Image" width="600" height="400" loading="lazy">
<em>Just a light press and hold will bring up that red pin</em></p>
<p>Once you've placed the pin, you'll see some options down at the bottom. You can choose to:</p>
<ul>
<li>Get directions from a certain place to that spot</li>
<li>Label that spot for future use</li>
<li>Share the GPS coordinates (via a link) through text, email, and so on</li>
<li>Download that map so you can access it offline</li>
</ul>
<h3 id="heading-step-2-share-your-pin">Step 2: Share your pin</h3>
<p>You can share your pin with a friend much the same way we did above. For example, you can send the coordinates/link via text:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/Dropped-pin-share.png" alt="Image" width="600" height="400" loading="lazy">
<em>Choose to share your location via air drop, message, email and so on.</em></p>
<p>You can also get direction from a location to the pin. If you choose this option, just select the "directions" tab and enter a starting spot.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/directions.png" alt="Image" width="600" height="400" loading="lazy">
<em>For the visual learners out there...</em></p>
<p>See, easy peasy :)</p>
<h3 id="heading-how-to-remove-the-pin-1">How to remove the pin</h3>
<p>If you want to remove that pin, simply hit the x in the search field and it'll disappear.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/Google-maps-dropped-pin-1.png" alt="Image" width="600" height="400" loading="lazy">
<em>Just clear the search field and the pin will go away.</em></p>
<p>Now you can always find your friends (or be found) - even if you're in the middle of nowhere.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to code a chatbot tailored for web apps like Google Maps ]]>
                </title>
                <description>
                    <![CDATA[ By Paul Pinard In this article, we’ll learn how to integrate a SAP Conversational AI chatbot into any of your web applications and provide users with a fun and intuitive way to interact with the UI! Conversational interfaces are gaining in popularity... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-code-a-chatbot-tailored-for-web-apps-like-google-maps-cf97fc090676/</link>
                <guid isPermaLink="false">66c3509ba1d481faeda49ba6</guid>
                
                    <category>
                        <![CDATA[ #chatbots ]]>
                    </category>
                
                    <category>
                        <![CDATA[ google maps ]]>
                    </category>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Applications ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Wed, 13 Mar 2019 08:25:25 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*aJhKGNE9DKAbp8YODtMfSQ.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Paul Pinard</p>
<p><em>In this article, we’ll learn how to integrate a SAP Conversational AI chatbot into any of your web applications and provide users with a fun and intuitive way to interact with the UI!</em></p>
<p>Conversational interfaces are gaining in popularity, especially for transacting with seemingly opaque backend systems. For example, we can deploy a chatbot to walk a customer through a troubleshooting process and create a ticket if they require further assistance; all without the customer having to know the ticket creation process.</p>
<p>This allows for a more intuitive experience for your customer, increasing customer satisfaction, while also improving efficiency by freeing employees from handling the classification and routing of tickets.</p>
<p>Conversational AI can handle this out of the box, but what if your users want to be able to interact with your front end application?</p>
<p>For example, it might be nice for your user to navigate to a certain page within your website without having to find the exact link. Or allow your user to apply a complex filter to a list of products without having to click around menus.</p>
<p>Though our webchat can be imbedded in any website, it does not have the contextual awareness of the UI necessary for these sorts of interactions. To demonstrate how we can accomplish this contextual awareness, we will create a simple map application with an embedded bot that has the ability to move the map and zoom in or out:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/toqt9Ke0kTZX07moBvygkjtYpv7qsRdFzxB0" alt="Image" width="800" height="414" loading="lazy"></p>
<h3 id="heading-resources">Resources</h3>
<p><a target="_blank" href="https://cai.tools.sap/blog/build-your-first-bot-with-sap-conversational-ai/">Create your first chatbot on SAP Conversational AI</a></p>
<p><a target="_blank" href="https://github.com/SAPConversationalAI/Webchat#self-hosted-webchat">Learn how to selfhost the Webchat</a></p>
<p><a target="_blank" href="https://developers.google.com/maps/documentation/javascript/tutorial">Google Maps APIs</a></p>
<p><a target="_blank" href="https://cai.tools.sap/timoteo/map-mover">Map mover bot</a></p>
<p><a target="_blank" href="https://github.com/timothy-janssen/map-app">Frontend Application source code</a></p>
<p><a target="_blank" href="https://map-app-demo-1.herokuapp.com/">Final Map Application</a></p>
<h3 id="heading-pre-requisites">Pre-requisites</h3>
<ul>
<li>First, you will need to be comfortable building a simple bot using <a target="_blank" href="https://cai.tools.sap/">SAP Conversational AI</a>. If you are unfamiliar with the platform, head over to <a target="_blank" href="https://cai.tools.sap/blog/build-your-first-bot-with-sap-conversational-ai/">this tutorial</a> to learn how to build a hilarious joke bot.</li>
<li>You will also need to be able to host our webchat component somewhere that you control. Our <a target="_blank" href="https://github.com/SAPConversationalAI/Webchat#self-hosted-webchat">GitHub</a> has all the information to get you started.</li>
<li>It is also expected that you are at least familiar with JavaScript and front end web development basics.</li>
</ul>
<h3 id="heading-tutorial">Tutorial</h3>
<p>To start, we will need to define the interface for our bot to be able to send commands and messages to our front end. This will be accomplished by sending a stringified JSON object in the place of the normal message string we generally send to the user. Our modified webchat will be able to understand this JSON object, take the defined action and finally display a “message” to the user.</p>
<p>This can be accomplished fairly simply; we will send an object with an action of either “<em>move</em>” or “<em>zoom</em>” and then a message that we can show to the user. Note that we will pass this JSON object as a string, and it is our assumption that the application will parse it and display only the value of “message” to the user.</p>
<pre><code>{ <span class="hljs-string">"action"</span>: <span class="hljs-string">"move"</span> || <span class="hljs-string">"zoom"</span>, <span class="hljs-string">"message"</span>: <span class="hljs-string">"This will be displayed to the user"</span> }
</code></pre><p>If our action type is “<em>move</em>”, the map will need coordinates to navigate to.<br>So, we will include a location’s coordinates in our JSON object. Alternatively, if our action is <em>zoom</em>, we will need to know whether to <em>zoom in</em> or <em>out</em>. For this, we will include a direction represented as a 1 for in or a -1 for out. With this defined, here are some examples of what our JSON objects could look like:</p>
<pre><code>{<span class="hljs-string">"action"</span>: <span class="hljs-string">"move"</span>, <span class="hljs-string">"location"</span>: { <span class="hljs-string">"lat"</span>: <span class="hljs-number">-8.3405389</span>, <span class="hljs-string">"Ing"</span>: <span class="hljs-number">115.0919509</span> <span class="hljs-string">"message"</span>: <span class="hljs-string">"Going to Bali, Indonesia!"</span> }{<span class="hljs-string">"action"</span>: <span class="hljs-string">"zoom"</span> <span class="hljs-string">"direction"</span>: <span class="hljs-number">1</span>, <span class="hljs-string">"message"</span>: <span class="hljs-string">"Zooming in!"</span>}
</code></pre><p>With that in mind, we can start building our bot. As always, we will start with defining the intents our user could say. In this case we have <em>zoom</em> and <em>move-map</em>.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/NIEtf89-2sa-bqKdTwqZHGGUZHtWPWMHoF7n" alt="Image" width="800" height="515" loading="lazy"></p>
<p>Note that we will need to tag the sentences in <em>@zoom</em> with the entity ‘direction’, but ‘location’ is automatically recognized in <em>@move-map</em>. Luckily for us, the location gold entity comes with the longitude and latitude out of the box, so we will be able to easily pass these to the front end.</p>
<p>To get the 1 or -1 that represents our zooming direction, we will leverage custom enrichments. We will add the keys “name” and “direction” with the following values. Then map the correct entity values to their respective key values.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/XZ0zra0PVE06eW8KruOypINZ4675DnIY6JJB" alt="Image" width="452" height="477" loading="lazy"></p>
<p>Now that we can recognize our move-map intent, we just need a skill that is triggered if our intent is matched:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/Zax0InkCgVVGJNFdLbbENHLmsesnwdhmnuBh" alt="Image" width="678" height="267" loading="lazy"></p>
<p>And requires a location:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/XyP2bn7OkfeOh75b5I5CcconwlgIdZZ1PPhk" alt="Image" width="676" height="288" loading="lazy"></p>
<p>And finally sends a message back telling the front-end where to go:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/BEwrDwYK-iaXCdAyYgT-npS2a2AJ7Fjvh1rG" alt="Image" width="800" height="473" loading="lazy"></p>
<p>The zoom skill can be implemented in much the same way; I encourage you to try it for yourself!</p>
<p>Now that our bot is done, we will need to host the webchat locally so that we can modify it to understand our “unusual” responses. If you are unfamiliar with the self-hosting process, check out <a target="_blank" href="https://github.com/SAPConversationalAI/Webchat#self-hosted-webchat">this github</a>.</p>
<p>Finally, it’s time to build our web application. We will start by including a container div for our map, the script we will write to handle the map interactions (map_controls.js), the necessary script as described in <a target="_blank" href="https://developers.google.com/maps/documentation/javascript/tutorial">this tutorial from Google</a>, and the script tag pointing to our locally hosted bot. It should look something like this:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/e4i94mJRLa5VonQkSluAfu0GyjxAvnNc0B5Z" alt="Image" width="800" height="288" loading="lazy"></p>
<p>To complete our simple application, we will implement our map initialization and zoom/move methods:</p>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">initMap</span> (<span class="hljs-params"></span>) </span>{  <span class="hljs-built_in">window</span>.map = <span class="hljs-keyword">new</span> google.maps.Map(<span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'map'</span>), {    <span class="hljs-comment">// OPTIONS    center: {lat: -34.397, lng: 150.644},    zoom: 8,    zoomControl: false,    streetViewControl: false,    mapTypeControl: false,    rotateControl: false,    scaleControl: false,    fullscreenControl: false  });}     const zoom = (direction) =&gt; {  window.map.setZoom(window.map.getZoom() + direction);}</span>
</code></pre><pre><code><span class="hljs-keyword">const</span> setCenter = <span class="hljs-function">(<span class="hljs-params">lat, lng</span>) =&gt;</span> {  <span class="hljs-built_in">window</span>.map.setCenter({<span class="hljs-attr">lat</span>: lat, <span class="hljs-attr">lng</span>: lng});}
</code></pre><p>Once we have the chatbot successfully added to our application, we will be able to ask it to move around or zoom in/out, but it will still just display that ugly JSON string to us. To solve that, we will add the following code to Webchat/src/containers/Chat/index.js. This will search the window object for a function called applicationParse and call it if it exists.</p>
<pre><code><span class="hljs-keyword">const</span> getApplicationParse =  <span class="hljs-function"><span class="hljs-params">messages</span>  =&gt;</span> {  <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Promise</span>(<span class="hljs-function"><span class="hljs-params">resolve</span> =&gt;</span> {    <span class="hljs-keyword">if</span> (!<span class="hljs-built_in">window</span>.webchatMethods || !<span class="hljs-built_in">window</span>.webchatMethods.applicationParse) {      <span class="hljs-keyword">return</span> resolve()    }    <span class="hljs-comment">// so that we process the message in all cases    setTimeout(resolve, MAX_GET_MEMORY_TIME)    try {      const applicationParseResponse = window.webchatMethods.applicationParse(messages)      if (!applicationParseResponse) {        return resolve()      }      if (applicationParseResponse.then &amp;&amp; typeof applicationParseResponse.then === 'function') {        // the function returned a Promise        applicationParseResponse          .then(applicationParse =&gt; resolve())          .catch(err =&gt; {            console.error(FAILED_TO_GET_MEMORY)            console.error(err)            resolve()          })      } else {        resolve()      }    } catch (err) {      console.error(FAILED_TO_GET_MEMORY)      console.error(err)      resolve()    }  })}</span>
</code></pre><p>Now, we will call getApplicationParse before the call to setState in componentWillReceiveProps. This will ensure that our application has a chance to parse the response from the bot before anything is sent back to the user.</p>
<pre><code>componentWillReceiveProps(nextProps) {  <span class="hljs-keyword">const</span> { messages, show } = nextProps    <span class="hljs-keyword">if</span> (messages !== <span class="hljs-built_in">this</span>.state.messages) {    getApplicationParse(messages)    <span class="hljs-built_in">this</span>.setState({ messages }, <span class="hljs-function">() =&gt;</span> {      <span class="hljs-keyword">const</span> { getLastMessage } = <span class="hljs-built_in">this</span>.props      <span class="hljs-keyword">if</span> (getLastMessage) {        getLastMessage(messages[messages.length - <span class="hljs-number">1</span>])      }    })  }  <span class="hljs-keyword">if</span> (show &amp;&amp; show !== <span class="hljs-built_in">this</span>.props.show &amp;&amp; !<span class="hljs-built_in">this</span>.props.sendMessagePromise &amp;&amp; !<span class="hljs-built_in">this</span>._isPolling) {    <span class="hljs-built_in">this</span>.doMessagesPolling()  }}
</code></pre><p>Finally, we need to implement applicationParse and include it in the window object from map_controls.js. Here, we will loop through our messages, and if it is a valid action command from the bot, take the action and return only the message back to the user.</p>
<pre><code><span class="hljs-built_in">window</span>.webchatMethods = {  <span class="hljs-attr">applicationParse</span>: <span class="hljs-function">(<span class="hljs-params">messages</span>) =&gt;</span> {    messages.map(<span class="hljs-function"><span class="hljs-params">message</span> =&gt;</span> {      <span class="hljs-keyword">try</span> {        <span class="hljs-keyword">var</span> obj = <span class="hljs-built_in">JSON</span>.parse(message.attachment.content);        <span class="hljs-built_in">console</span>.log(obj);        <span class="hljs-keyword">if</span>(obj !== <span class="hljs-literal">undefined</span> &amp;&amp;            obj.action == <span class="hljs-string">'zoom'</span> &amp;&amp;            <span class="hljs-keyword">typeof</span> obj.direction === <span class="hljs-string">"number"</span>){          message.attachment.content = obj.message.toString();          zoom(obj.direction);        } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (obj !== <span class="hljs-literal">undefined</span> &amp;&amp;                    obj.action == <span class="hljs-string">'move'</span> &amp;&amp;                    <span class="hljs-keyword">typeof</span> obj.location.lat === <span class="hljs-string">"number"</span> &amp;&amp;                    <span class="hljs-keyword">typeof</span> obj.location.lng === <span class="hljs-string">"number"</span>) {          message.attachment.content = obj.message.toString();          setCenter(obj.location.lat, obj.location.lng);        }      } <span class="hljs-keyword">catch</span> (err) {        <span class="hljs-comment">// Invalid JSON - treat it as a regular message and pass it back to UI as is      }      message    })     return messages;       }}</span>
</code></pre><p>You can now ask your bot to move or zoom the map and it will send a message that the application can interpret and act upon.</p>
<p>With this tool in your tool belt, you can now integrate a chatbot into any of your web applications!</p>
<p><em>Originally published on <a target="_blank" href="https://cai.tools.sap/blog/how-to-control-your-web-application-with-an-integrated-chatbot/">SAP Conversational AI blog</a>.</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to change the color of Google Maps markers with JavaScript ]]>
                </title>
                <description>
                    <![CDATA[ By Tan Le Tian Make them pink, blue, green, yellow or purple! By default, the Google Maps marker is red in color. This article will show how to add different color markers to Google Maps. So, let’s get started. ? 1. Load Google Maps Create an HTML f... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-change-javascript-google-map-marker-color-8a72131d1207/</link>
                <guid isPermaLink="false">66c350769972b7c5c7624ed0</guid>
                
                    <category>
                        <![CDATA[ google maps ]]>
                    </category>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Thu, 19 Jul 2018 13:16:56 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*d635FJj7G3ZEAZdyLUaeSg.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Tan Le Tian</p>
<h4 id="heading-make-them-pink-blue-green-yellow-or-purple">Make them pink, blue, green, yellow or purple!</h4>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*d635FJj7G3ZEAZdyLUaeSg.png" alt="Image" width="800" height="275" loading="lazy"></p>
<p>By default, the Google Maps marker is red in color. This article will show how to add different color markers to Google Maps. So, let’s get started. ?</p>
<h3 id="heading-1-load-google-maps">1. Load Google Maps</h3>
<p>Create an HTML file which loads Google Maps by following <a target="_blank" href="https://developers.google.com/maps/documentation/javascript/tutorial">Google Maps API official docs: Hello World</a>.</p>
<p>Your code will look something like the code snippet below.</p>
<p><strong>Note:</strong> Remember to change <code>YOUR_API_KEY</code> to your actual Google Maps API key.</p>
<h3 id="heading-2-add-different-color-markers">2. Add different color markers</h3>
<p>To add a blue color marker, we need to change the icon of the marker. This is done by adding an icon property and specifying a URL for it like below.</p>
<pre><code>icon: {                               <span class="hljs-attr">url</span>: <span class="hljs-string">"http://maps.google.com/mapfiles/ms/icons/blue-dot.png"</span>                           }
</code></pre><p>Note that we specify <code>blue-dot.png</code> at the end of the URL to get a blue marker. To add a green marker simply change it to <code>green-dot.png</code> so that the URL will be <code>[http://maps.google.com/mapfiles/ms/icons/green-dot.png](http://maps.google.com/mapfiles/ms/icons/blue-dot.png)</code> .</p>
<p>Some other colors available:</p>
<ol>
<li>pink: <code>pink-dot.png</code></li>
<li>yellow: <code>yellow-dot.png</code></li>
<li>purple: <code>purple-dot.png</code></li>
</ol>
<p>To get the URL of more marker icons, please refer to <a target="_blank" href="https://sites.google.com/site/gmapsdevelopment/">this website</a>.</p>
<h3 id="heading-3-wrap-into-add-marker-function">3. Wrap into add marker function</h3>
<p>To make the code cleaner, we can define an <code>addMarker</code> function which takes in <code>latLng</code> and <code>color</code> of the marker. Note that we store the markers added in the a global <code>markersArray</code> in case we need to perform any operations on the markers later.</p>
<p>Open the HTML file in the browser. It should look like this:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*vkqPZHbgS4iz9zOtVKvf6g.png" alt="Image" width="645" height="347" loading="lazy"></p>
<p>You can get the full final version of the code from <a target="_blank" href="https://gist.github.com/getsudocode/605bf60f5de40eb3f6b00addd93c913d">here</a>. Please let me know how it goes in the comments below.</p>
<p>Feel free to check out another Google Maps tutorial I have written:<br><a target="_blank" href="https://medium.com/@letian1997/click-javascript-google-map-add-draggable-markers-polyline-b834dd5762b2">Implement click on JavaScript Google Map to add draggable markers with polyline</a></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to scrape with Ruby and Nokogiri and map the data ]]>
                </title>
                <description>
                    <![CDATA[ By Andrew Bales Sometimes you want to grab data from a website for your own project. So what do you use? Ruby, Nokogiri, and JSON to the rescue! Recently, I was working on a project to map data about bridges. Using Nokogiri, I was able to capture a c... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-scrape-with-ruby-and-nokogiri-and-map-the-data-bd9febb5e18a/</link>
                <guid isPermaLink="false">66c3545653e0c377d44064d2</guid>
                
                    <category>
                        <![CDATA[ Nokogiri ]]>
                    </category>
                
                    <category>
                        <![CDATA[ google maps ]]>
                    </category>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Ruby ]]>
                    </category>
                
                    <category>
                        <![CDATA[ technology ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Thu, 24 May 2018 22:52:19 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*kUyC5E-rXXkL4DcR8L91rA.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Andrew Bales</p>
<p>Sometimes you want to grab data from a website for your own project. So what do you use? Ruby, Nokogiri, and JSON to the rescue!</p>
<p>Recently, I was working on a project to map <a target="_blank" href="https://bridgereports.com/">data about bridges</a>. Using Nokogiri, I was able to capture a city’s bridge data from a table. I then used links within that same table to scrape associated pages. Finally, I converted the scraped data to JSON and used it to populate a Google Map.</p>
<p>This article walks you through the tools I used and how the code works!</p>
<p>See the full code on my <a target="_blank" href="https://github.com/agbales/wichita-bridges">GitHub</a> repo.</p>
<p>Live map demo <a target="_blank" href="https://agbales.github.io/wichita-bridges/">here</a>.</p>
<h3 id="heading-the-project">The Project</h3>
<p>My goal was to take a table from a bridge data <a target="_blank" href="https://bridgereports.com/">website</a> and turn it into a Google map with geolocated pins that would produce informational popups for each bridge.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/pTodl03NV9GsnFl6mYtcO0-rPk6F8AUjRyBb" alt="Image" width="800" height="348" loading="lazy">
<em>The Idea: HTML Table to Map</em></p>
<p>To make this happen, I’d need to:</p>
<ol>
<li>Scrape data from the original website.</li>
<li>Convert that data into a <a target="_blank" href="https://www.w3schools.com/js/js_json_objects.asp">JSON object</a>.</li>
<li>Apply that data to make a new, interactive map.</li>
</ol>
<p>Your project will vary, surely — how many people are trying to map antique bridges? — but I hope this process will prove useful for your context.</p>
<h3 id="heading-nokogiri">Nokogiri</h3>
<p>Ruby has an amazing web scraping gem called <a target="_blank" href="https://github.com/sparklemotion/nokogiri">Nokogiri</a>. Among other features, it allows you to search HTML documents by CSS selectors. That means if we know the ids, classes, or even types of elements where the data is stored in the DOM, we’re able to pluck it out.</p>
<h4 id="heading-the-scraper">The scraper</h4>
<p>If you’re following along with the <a target="_blank" href="https://github.com/agbales/wichita-bridges">GibHub repo</a>, you can find my scraper in bridges_scraper.rb</p>
<pre><code><span class="hljs-built_in">require</span> <span class="hljs-string">'open-uri'</span><span class="hljs-built_in">require</span> <span class="hljs-string">'nokogiri'</span><span class="hljs-built_in">require</span> <span class="hljs-string">'json'</span>
</code></pre><p>Open-uri lets us open the HTML like a file and pass it to Nokogiri for the heavy lifting.</p>
<p>In the code below, I’m passing the DOM information from the URL with the bridge data over to Nokogiri. I then find the table element holding the data, search for its rows, and iterate through them.</p>
<pre><code>url = <span class="hljs-string">'https://bridgereports.com/city/wichita-kansas/'</span>html = open(url)
</code></pre><pre><code>doc = Nokogiri::HTML(html)bridges = []table = doc.at(<span class="hljs-string">'table'</span>)
</code></pre><pre><code>table.search(<span class="hljs-string">'tr'</span>).each <span class="hljs-keyword">do</span> |tr|  bridges.push(    carries: cells[<span class="hljs-number">1</span>].text,    <span class="hljs-attr">crosses</span>: cells[<span class="hljs-number">2</span>].text,    <span class="hljs-attr">location</span>: cells[<span class="hljs-number">3</span>].text,    <span class="hljs-attr">design</span>: cells[<span class="hljs-number">4</span>].text,    <span class="hljs-attr">status</span>: cells[<span class="hljs-number">5</span>].text,    <span class="hljs-attr">year_build</span>: cells[<span class="hljs-number">6</span>].text.to_i,    <span class="hljs-attr">year_recon</span>: cells[<span class="hljs-number">7</span>].text,    <span class="hljs-attr">span_length</span>: cells[<span class="hljs-number">8</span>].text.to_f,    <span class="hljs-attr">total_length</span>: cells[<span class="hljs-number">9</span>].text.to_f,    <span class="hljs-attr">condition</span>: cells[<span class="hljs-number">10</span>].text,    <span class="hljs-attr">suff_rating</span>: cells[<span class="hljs-number">11</span>].text.to_f,    <span class="hljs-attr">id</span>: cells[<span class="hljs-number">12</span>].text.to_i  )end
</code></pre><pre><code>json = <span class="hljs-built_in">JSON</span>.pretty_generate(bridges)File.open(<span class="hljs-string">"data.json"</span>, <span class="hljs-string">'w'</span>) { |file| file.write(json) }
</code></pre><p>Nokogiri has lots of methods (here’s a <a target="_blank" href="https://github.com/sparklemotion/nokogiri/wiki/Cheat-sheet">cheat sheet</a> and a starter <a target="_blank" href="https://readysteadycode.com/howto-parse-html-with-ruby-and-nokogiri">guide</a>!). We’re using just a few.</p>
<p>The table is found with <strong>.at(‘table’)</strong>, which returns the first occurrence of a table element in the DOM. This works just fine for this relatively simple page.</p>
<p>With the table in hand, <strong>.search(‘tr’)</strong> provides an array of the row elements that we iterate over with <strong>.each</strong>. In each row, the data is cleaned up and pushed into a single entry for the bridges array.</p>
<p>After all the rows are collected, the data is converted into JSON and saved in a new file called “data.json”.</p>
<h3 id="heading-combining-data-from-multiple-pages">Combining data from multiple pages</h3>
<p>In this case, I needed information from other associated pages. Specifically, I needed the latitude and longitude of each bridge, which was not featured on the table. However, I found that the link in the first cell of each row led to a page that <em>did</em> provide those details.</p>
<p>I needed to write code that did a few things:</p>
<ul>
<li>Gathered links from the first cell in the table.</li>
<li>Created a new Nokogiri object from the HTML on that page.</li>
<li>Pluck out the latitude and longitude.</li>
<li>Sleep the program until that process completes.</li>
</ul>
<pre><code>cells = tr.search(<span class="hljs-string">'th, td'</span>)  links = {}  cells[<span class="hljs-number">0</span>].css(<span class="hljs-string">'a'</span>).each <span class="hljs-keyword">do</span> |a|    links[a.text] = a[<span class="hljs-string">'href'</span>]  end    got_coords = <span class="hljs-literal">false</span>    <span class="hljs-keyword">if</span> links[<span class="hljs-string">'NBI report'</span>]    nbi = links[<span class="hljs-string">'NBI report'</span>]    report = <span class="hljs-string">"https://bridgereports.com"</span> + nbi    report_html = open(report)    sleep <span class="hljs-number">1</span> until report_html    r = Nokogiri::HTML(report_html)        lat = r.css(<span class="hljs-string">'span.latitude'</span>).text.strip.to_f    long = r.css(<span class="hljs-string">'span.longitude'</span>).text.strip.to_f
</code></pre><pre><code>    got_coords = <span class="hljs-literal">true</span>  <span class="hljs-keyword">else</span>    got_coords = <span class="hljs-literal">true</span>  end    sleep <span class="hljs-number">1</span> until got_coords == <span class="hljs-literal">true</span>
</code></pre><pre><code>  bridges.push(        links: links,        <span class="hljs-attr">latitude</span>: lat,        <span class="hljs-attr">longitude</span>: long,        <span class="hljs-attr">carries</span>: cells[<span class="hljs-number">1</span>].text,        ..., # all other previous key/value pairs  )end
</code></pre><p>A few additional things are worth pointing out here:</p>
<ul>
<li>I’m using the “got_coords” as a simple binary. This is set to <strong>false</strong> by default and is toggled when the data is captured OR simply not available.</li>
<li>The latitude and longitude are located in spans with corresponding classes. That makes securing the data simple: <strong>.css(‘span.latitude’)</strong> This is followed by <strong>.text, .strip</strong> and <strong>.to_f</strong> which 1) gets the text from the span, 2) strips any excess whitespace, and 3) converts the string to a float number.</li>
</ul>
<h3 id="heading-json-google-map"><strong>JSON → Google Map</strong></h3>
<p>The newly formed JSON object has to be modified a touch to fit the Google Maps API. I did this with JavaScript inside <strong>map.js</strong></p>
<p>The JSON data is accessible within <strong>map.js</strong> because it has been moved to the JS folder, assigned to a variable called “bridge_data”, and included in a </p> ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
