<?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 — GPS emulation doesn't work]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=713</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=713&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in GPS emulation doesn't work.]]></description>
		<lastBuildDate>Wed, 29 Nov 2017 11:11:58 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: GPS emulation doesn't work]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3089#p3089</link>
			<description><![CDATA[<p>I just checked it out.<br />OnLocationChanged works correctly.<br />The problem is that the name of GetLocation method does not match the behavior, and is misleading.<br />This method is used to internally get coordinates from Unity Location Service.<br />The user can override this method if he wants to get coordinates from another source, for example from the device&#039;s sensors directly.<br />We&#039;ll figure out how to fix this (rename or change the visibility of the method).</p><p>The right way to get the coordinates is:<br /></p><div class="codebox"><pre><code>Vector2 position = OnlineMapsLocationService.instance.position;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 29 Nov 2017 11:11:58 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3089#p3089</guid>
		</item>
		<item>
			<title><![CDATA[Re: GPS emulation doesn't work]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3088#p3088</link>
			<description><![CDATA[<p>Alex, thank you for the reply. I have tried the following code:<br /></p><div class="codebox"><pre><code>    public Text txtGPS;

    void Start () {
        ...
        OnlineMapsLocationService.instance.OnLocationChanged += OnLocationChanged;
    }

    private void OnLocationChanged(Vector2 position) {
        float lon, lat;
        OnlineMapsLocationService.instance.GetLocation (out lon, out lat);
        txtGPS.text = &quot; Lat: &quot;+lat+&quot;\nLon: &quot;+lon;
    }</code></pre></div><p>There are my OnlineMapsLocationService component settings:<br />Desired Acuracy (meters): 1<br />Compass Threshold: 8<br />Find Location By IP: [checked]<br />Update Map Position: [checked]<br />Update Distance: 2<br />Auto Stop On Input: [not checked]<br />Restore After (sec): 10<br />Create Marker: [not checked]<br />Use GPS Emulator: [checked]<br />Disable Emulator on Publish: [checked]<br />Latitude: 55.7522<br />Longitude: 37.6156<br />Compass (0-360): 0</p><p>Unfortunately, there were no one OnLocationChanged() call running in Unity3D Editor during 10 minutes. On the phone the code works fine, GPS coordinates are shown and changing.</p>]]></description>
			<author><![CDATA[null@example.com (YanaAzur)]]></author>
			<pubDate>Wed, 29 Nov 2017 10:15:09 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3088#p3088</guid>
		</item>
		<item>
			<title><![CDATA[Re: GPS emulation doesn't work]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3087#p3087</link>
			<description><![CDATA[<p>Hello.</p><p>Most likely the problem is that you are trying to get a location in Start.<br />GPS is not available in Start, and GPS emulator too.</p><p>Use OnlineMapsLocationServiceBase.OnLocationInited or OnlineMapsLocationServiceBase.OnLocationChanged to determine that GPS (or emulator) is initialized.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 28 Nov 2017 18:51:40 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3087#p3087</guid>
		</item>
		<item>
			<title><![CDATA[GPS emulation doesn't work]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3086#p3086</link>
			<description><![CDATA[<p>I try to use GPS emulation running application in Unity3D Editor. I have checked &quot;Use GPS Emulator&quot; and entered Latitude: 37.61713, Longitude: 55.75581, Compass: 0 in OnlineMapsLocationService component.</p><p>But the following code<br /></p><div class="codebox"><pre><code>float lon, lat;
OnlineMapsLocationService.instance.GetLocation (out lon, out lat);</code></pre></div><p>returns zeroes in lon and lat variables.</p><p>What do I need to do to start GPS emulation?</p>]]></description>
			<author><![CDATA[null@example.com (YanaAzur)]]></author>
			<pubDate>Tue, 28 Nov 2017 17:36:34 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3086#p3086</guid>
		</item>
	</channel>
</rss>
