<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — How to import map into Online maps？]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=734&amp;type=atom" />
	<updated>2018-01-03T15:55:21Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=734</id>
		<entry>
			<title type="html"><![CDATA[Re: How to import map into Online maps？]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3190#p3190" />
			<content type="html"><![CDATA[<p>No, this map can not be used via «Provider - Custom», because it has offsets (zoom, x, y).</p><p>As is - this has limited usage via Online Maps API.<br />This means that getting the coordinates will not work correctly.</p><p>To getting the coordinates work correctly, you need to make that your tiles match to WGS84 tiles.<br /><a href="http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/">http://www.maptiler.org/google-maps-coo … rojection/</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-01-03T15:55:21Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3190#p3190</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to import map into Online maps？]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3189#p3189" />
			<content type="html"><![CDATA[<p>Can this map be imported by &quot;Provider - Custom&quot; ?<br /><a href="http://www.cjyhgl.com:6080/arcgis/rest/services/basemap5/MapServer">http://www.cjyhgl.com:6080/arcgis/rest/ … /MapServer</a></p>]]></content>
			<author>
				<name><![CDATA[unity_project]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=616</uri>
			</author>
			<updated>2018-01-03T15:33:57Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3189#p3189</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to import map into Online maps？]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3185#p3185" />
			<content type="html"><![CDATA[<p>Something like:<br /></p><div class="codebox"><pre><code>using System;
using System.Text;
using UnityEngine;

public class HuadongArcGIS:MonoBehaviour
{
    private int zoomOffset = 6;
    private int xOffset = 22;
    private int yOffset = 1;

    private OnlineMaps map;

    private void Start()
    {
        map = OnlineMaps.instance;
        map.OnStartDownloadTile += OnStartDownloadTile;
        if (OnlineMapsCache.instance != null) OnlineMapsCache.instance.OnStartDownloadTile += OnStartDownloadTile;
    }

    private void OnStartDownloadTile(OnlineMapsTile tile)
    {
        int zoom = tile.zoom - zoomOffset;
        if (zoom &lt; 0)
        {
            tile.status = OnlineMapsTileStatus.error;
            return;
        }

        tile.status = OnlineMapsTileStatus.loading;

        StringBuilder builder = new StringBuilder(&quot;http://www.cjyhgl.com:6080/arcgis/rest/services/huadong1/MapServer/tile/&quot;);
        builder.Append(zoom).Append(&quot;/&quot;).Append(tile.y - yOffset * (1 &lt;&lt; zoom)).Append(&quot;/&quot;).Append(tile.x - xOffset * (1 &lt;&lt; zoom));

        OnlineMapsWWW www = OnlineMapsUtils.GetWWW(builder);
        www.OnComplete += delegate
        {
            if (string.IsNullOrEmpty(www.error))
            {
                Texture2D tileTexture = new Texture2D(256, 256, TextureFormat.ARGB32, map.control.mipmapForTiles);
                tileTexture.LoadImage(www.bytes);
                tileTexture.wrapMode = TextureWrapMode.Clamp;

                if (map.target == OnlineMapsTarget.texture)
                {
                    tile.ApplyTexture(tileTexture);
                    map.buffer.ApplyTile(tile);
                    OnlineMapsUtils.DestroyImmediate(tileTexture);
                }
                else
                {
                    tile.texture = tileTexture;
                    tile.status = OnlineMapsTileStatus.loaded;
                }

                tile.MarkLoaded();
                map.Redraw();
            }
            else
            {
                tile.status = OnlineMapsTileStatus.error;
            }
        };
    }
}</code></pre></div><p>But keep in mind that your tiles do not match WGS84 tiles, and getting the coordinates will not work correctly.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-01-01T17:21:00Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3185#p3185</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to import map into Online maps？]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3183#p3183" />
			<content type="html"><![CDATA[<p>Thanks for your answer, i want to import 6 tiles for making up my map. The URL of my tiles are:<br /><a href="http://www.cjyhgl.com:6080/arcgis/rest/services/huadong1/MapServer/tile/0/23/30">http://www.cjyhgl.com:6080/arcgis/rest/ … le/0/23/30</a>, ../0/23/31, ../0/24/30, ../24.31, ../25/30, <br />../25/31, how do I import 6 tiles by URLs and adjust the position of 6 tiles?</p>]]></content>
			<author>
				<name><![CDATA[unity_project]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=616</uri>
			</author>
			<updated>2018-01-01T13:10:54Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3183#p3183</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to import map into Online maps？]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3174#p3174" />
			<content type="html"><![CDATA[<p>&quot;Provider - Custom&quot; can load multiple tiles.<br />To do this, you replace in URL the numbers (zoom, tile x, tile y) to tokens ({zoom}, {x}, {y}).<br />But &quot;Provider - Custom&quot; can not work with zoom offset.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-12-29T12:37:46Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3174#p3174</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to import map into Online maps？]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3172#p3172" />
			<content type="html"><![CDATA[<p>Thanks for your reminder, I can import the tile into unity via URL by changing the map to WGS-84. But I want to know, using &quot;Provider-custom&quot; can only import one tile? What should I do if I want to import multiple tiles?</p>]]></content>
			<author>
				<name><![CDATA[unity_project]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=616</uri>
			</author>
			<updated>2017-12-29T06:38:31Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3172#p3172</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to import map into Online maps？]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3170#p3170" />
			<content type="html"><![CDATA[<p>1. Online Maps has built-in support only for WGS-84 (Ellipsoid Mercator) and WGS-84 WebMercator (Spherical Mercator) projections.<br />Your tiles use Lambert Conformal Conic.<br />Theoretically, you can implement your own projection, and use it for the map.<br />Points of interest:<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsProjection.html">http://infinity-code.com/doxygen/online … ction.html</a><br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsProvider.html#a5bc413959816424e1d07801ef1b24402">http://infinity-code.com/doxygen/online … 1ef1b24402</a></p><p>2. Your tiles have zoom offset = 8.<br />You can download tiles with a offset only using Online Maps API.<br /><a href="http://infinity-code.com/atlas/online-maps/pages/CustomDownloadTileExample.html">http://infinity-code.com/atlas/online-m … ample.html</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-12-28T08:04:44Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3170#p3170</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to import map into Online maps？]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3168#p3168" />
			<content type="html"><![CDATA[<p>Thanks for your answer，but my URL is something different from the URL in the documentation,&nbsp; <br />here is one of my tail&#039;s URL: <a href="http://www.cjyhgl.com:6080/arcgis/rest/services/huadong/MapServer/tile/0/85/69">http://www.cjyhgl.com:6080/arcgis/rest/ … le/0/85/69</a><br />In step 7,&nbsp; &nbsp;&quot;In the «URL» replace «!1iX!2iX!3iX», to «! 1i{zoom}!2i{x}!3i{y}».&quot; should i change my URL by replacing /0/85/69 to!1i{0}!2i{85}!3i{69}<br />and my URL change to like&nbsp; ...st/services/huadong/MapServer/tile/!1i{0}!2i{85}!3i{69}?<br />and in step 8, &quot;Make sure URL ends at «!4e0» (inclusive). If you have characters after this, delete them.&quot; , my URL doesn&#039;t have !4e0, How should I modify my URL to meet the requirements</p>]]></content>
			<author>
				<name><![CDATA[unity_project]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=616</uri>
			</author>
			<updated>2017-12-28T02:48:48Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3168#p3168</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to import map into Online maps？]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3166#p3166" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Select &quot;Provider - Custom&quot;, and specify the URL of the tiles.<br />Step-by-step instructions on how to find this URL in the documentation (section Styled Google Maps).</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-12-27T05:55:16Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3166#p3166</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[How to import map into Online maps？]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3164#p3164" />
			<content type="html"><![CDATA[<p>I&#039;m a novice in Online maps, I&#039;ve used Arcgis to generate the map, and upload maps to Arcgis server. I can use my browser to open the map URL.<br />&nbsp; I want to know how to import my Arcgis map into Unity by Online maps, whether using local map files or online URL?</p>]]></content>
			<author>
				<name><![CDATA[unity_project]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=616</uri>
			</author>
			<updated>2017-12-26T12:08:16Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3164#p3164</id>
		</entry>
</feed>
