<?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 — Disable user drag control (keep zoom control)]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=128</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=128&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Disable user drag control (keep zoom control).]]></description>
		<lastBuildDate>Wed, 10 Aug 2016 13:20:36 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Disable user drag control (keep zoom control)]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1083#p1083</link>
			<description><![CDATA[<p>Hello.</p><p>No, this feature has not yet been implemented.<br />Use the examples above.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 10 Aug 2016 13:20:36 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1083#p1083</guid>
		</item>
		<item>
			<title><![CDATA[Re: Disable user drag control (keep zoom control)]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1081#p1081</link>
			<description><![CDATA[<p>@Alex,<br />Have you provided this feature in recent updates?<br />or should i use the code you wrote?</p>]]></description>
			<author><![CDATA[null@example.com (johnGate)]]></author>
			<pubDate>Wed, 10 Aug 2016 10:26:59 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1081#p1081</guid>
		</item>
		<item>
			<title><![CDATA[Re: Disable user drag control (keep zoom control)]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=556#p556</link>
			<description><![CDATA[<p>Hi,</p><p>Thanks for your help and time.</p><p>I resolve last question by follow:</p><div class="codebox"><pre><code>private Vector2 mapCenter;

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

    private void OnLocationChanged(Vector2 position)
   {
        mapCenter = position;
   }

   private void OnMapPress()
  {
        OnlineMaps.instance.OnUpdateBefore += OnUpdateBefore;
  }

  private void OnUpdateBefore()
  {
        OnlineMapsControlBase.instance.isMapDrag = false;
        OnlineMaps.instance.OnUpdateBefore -= OnUpdateBefore;
  }

  private void OnMapZoom()
  {
        OnlineMaps.instance.position = mapCenter;
  }</code></pre></div><p>regards,</p>]]></description>
			<author><![CDATA[null@example.com (dgonzalez)]]></author>
			<pubDate>Wed, 06 Apr 2016 22:24:51 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=556#p556</guid>
		</item>
		<item>
			<title><![CDATA[Re: Disable user drag control (keep zoom control)]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=555#p555</link>
			<description><![CDATA[<p>In the current version there is no such field.<br />Nobody asked about this before.<br />We will add this field in the next version.<br />I think this is useful in some cases.</p><p>You can work around this in the following way:<br /></p><div class="codebox"><pre><code>public class LockPositionExample2 : MonoBehaviour 
{
    private Vector2 originalPosition;

    private void Start () 
    {
        OnlineMapsControlBase.instance.OnMapPress += OnMapPress;
        OnlineMapsControlBase.instance.OnMapRelease += OnMapRelease;
    }

    private void OnChangePosition()
    {
        OnlineMaps.instance.dispatchEvents = false;
        OnlineMaps.instance.position = originalPosition;
        OnlineMaps.instance.dispatchEvents = true;
    }

    private void OnMapPress()
    {
        originalPosition = OnlineMaps.instance.position;
        OnlineMaps.instance.OnUpdateBefore += OnUpdateBefore;
        OnlineMaps.instance.OnChangePosition += OnChangePosition;
    }

    private void OnMapRelease()
    {
        OnlineMaps.instance.OnChangePosition -= OnChangePosition;
    }

    private void OnUpdateBefore()
    {
        OnlineMapsControlBase.instance.isMapDrag = false;
        OnlineMaps.instance.OnUpdateBefore -= OnUpdateBefore;
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 06 Apr 2016 22:11:09 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=555#p555</guid>
		</item>
		<item>
			<title><![CDATA[Re: Disable user drag control (keep zoom control)]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=554#p554</link>
			<description><![CDATA[<p>Hi Alex,</p><p>Works perfect!</p><p>A last question, Is there way to get and change &quot;zoom mode&quot; for OnlineMapsUIImageControl?, since I am not working with tiles set and OnlineMapsUIImageControl object does not have a smoothZoomMode attribute to change its value to &quot;center&quot;.</p><p>thanks and regards.</p>]]></description>
			<author><![CDATA[null@example.com (dgonzalez)]]></author>
			<pubDate>Wed, 06 Apr 2016 21:05:46 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=554#p554</guid>
		</item>
		<item>
			<title><![CDATA[Re: Disable user drag control (keep zoom control)]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=553#p553</link>
			<description><![CDATA[<p>Hello.</p><p>Unfortunately, there is no built-in way to do this.<br />But there is a little trick, how to cancel the map drag.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 06 Apr 2016 19:38:55 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=553#p553</guid>
		</item>
		<item>
			<title><![CDATA[Disable user drag control (keep zoom control)]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=552#p552</link>
			<description><![CDATA[<p>Hi,</p><p>We need to disable user drag control but keeping user zoom control. We want to display some markers around the user current location avoiding that user move outside of a radius (keeping center of map)</p><p>Is it possible? We only find the &quot;Allow user control option&quot;, but it disable drag and zoom controls.</p><p>thanks,</p>]]></description>
			<author><![CDATA[null@example.com (dgonzalez)]]></author>
			<pubDate>Wed, 06 Apr 2016 14:33:31 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=552#p552</guid>
		</item>
	</channel>
</rss>
