<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — Getting Speed Limit]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=1681</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1681&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Getting Speed Limit.]]></description>
		<lastBuildDate>Wed, 20 Jan 2021 00:19:01 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Getting Speed Limit]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7076#p7076</link>
			<description><![CDATA[<p>Alex, Thanks Again!</p><p>Pointed me in the direction I needed!</p>]]></description>
			<author><![CDATA[null@example.com (AppFreak)]]></author>
			<pubDate>Wed, 20 Jan 2021 00:19:01 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7076#p7076</guid>
		</item>
		<item>
			<title><![CDATA[Re: Getting Speed Limit]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7075#p7075</link>
			<description><![CDATA[<p>Hello.</p><p>GetSpeedLimitResults returns an array of results objects from the response string.<br /></p><div class="codebox"><pre><code>OnlineMapsGoogleRoads.SpeedLimitResult[] results = OnlineMapsGoogleRoads.GetSpeedLimitResults(response);</code></pre></div><p>Full example:<br /></p><div class="codebox"><pre><code>using System;
using UnityEngine;

public class SpeedLimitsExample : MonoBehaviour
{
    private void Start()
    {
        OnlineMapsGoogleRoads request = OnlineMapsGoogleRoads.SpeedLimits(
            OnlineMapsKeyManager.GoogleMaps(), // Key From KeyManager

            // IEnumerable values can be float, double, Vector2 or string.&lt;br/&gt;
            // If values is string, it must contain placeId.&lt;br/&gt;
            // If values is float, double or Vector2, it must contain coordinates.
            new[]
            {
                &quot;ChIJX12duJAwGQ0Ra0d4Oi4jOGE&quot;,
                &quot;ChIJLQcticc0GQ0RoiNZJVa5GxU&quot;
            } 
        );
        request.OnComplete += OnRoadsAPIComplete;
    }

    private void OnRoadsAPIComplete(string response)
    {
        try
        {
            OnlineMapsGoogleRoads.SpeedLimitResult[] speedLimits = OnlineMapsGoogleRoads.GetSpeedLimitResults(response);
            foreach (OnlineMapsGoogleRoads.SpeedLimitResult limit in speedLimits)
            {
                Debug.Log(limit.speedLimit);
            }
        }
        catch (Exception e)
        {
            Debug.LogError(response);
        }

    }
}</code></pre></div><p>P.S. This example has not been tested because I do not have a Google Maps Platform Premium Plan and do not have access to Speed limits.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 19 Jan 2021 09:55:49 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7075#p7075</guid>
		</item>
		<item>
			<title><![CDATA[Getting Speed Limit]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7074#p7074</link>
			<description><![CDATA[<p>I&#039;m trying to get the current speed limit using the OnlineMapsGoogleRoads module with the code below and the API shows that the GetSpeedLimitResults needs a string response but it is giving me a &quot;Invalid Expression Term &#039;String&#039; &quot; error for my response variable. Couldn&#039;t find any examples so do I have this correct?</p><p>private OnlineMapsGoogleRoads.SpeedLimitResult speedLR;</p><br /><p>public void ShowSpeedLimit() {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; speedLR.speedLimit = OnlineMapsGoogleRoads.GetSpeedLimitResults(string resp);<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; Debug.Log(&quot;ShowSpeedLimit - Speed Limit: &quot; + speedLR.speedLimit.ToString());<br />&nbsp; &nbsp; Debug.Log(&quot;ShowSpeedLimit - Speed Limit Type: &quot; + speedLR.units.ToString());</p><p>&nbsp; &nbsp; speedLimitData.GetComponent&lt;TMPro.TextMeshProUGUI&gt;().text = speedLR.speedLimit.ToString();</p><p>}</p>]]></description>
			<author><![CDATA[null@example.com (AppFreak)]]></author>
			<pubDate>Mon, 18 Jan 2021 19:53:35 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7074#p7074</guid>
		</item>
	</channel>
</rss>
