viewimage.php?id=2abcdd23dad63db0&no=24b0d769e1d32ca73cec83fa11d0283146e1de228a7923f189a7bc5598277e6888f00e861e76ce7ac831fb122d3e8e75b48ad640a54b680739498128ed26c3a807f9f4


์œ ๋‹ˆํ‹ฐ์—๋‹ค๊ฐ€ ๊ตฌ๊ธ€์ง€๋„์ข€ ์—ฐ๋™์‹œ์ผœ๋ณผ๋ ค๊ณ  ํ•˜๋Š”๋ฐ ์ž๊พธ ๋นจ๊ฐ„์ƒ‰ ๋ฌผ์Œํ‘œ๊ฐ€ ๋œจ๊ณ ์žˆ๋Š” ์ƒํƒœ์•ผ

api key๋Š” google static map api key ๋ฐ›์•„์„œ ์‚ฌ์šฉํ•˜๊ณ ์žˆ๋Š”๋ฐ ์–ด๋””์„œ ๋ฌธ์ œ๊ฐ€ ๋‚œ๊ฑด์ง€ ๋ชจ๋ฅด๊ฒ ์–ด


๊ทธ๋ƒฅ ์œ ํŠœ๋ธŒ๋‚˜ ๋‹ค๋ฅธ ๋ธ”๋กœ๊ทธ์—์„œ ๊ฐ€์ ธ์˜จ ์†Œ์Šค ๊ทธ๋Œ€๋กœ ๋ฐ›์•„์„œ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š”๋ฐ ์กฐ์–ธ์ข€ ํ•ด์ค˜


using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEngine.UI;


public class GoogleApiTest : MonoBehaviour

{

public RawImage img;


string url;


public float lat;

public float lon;


LocationInfo li;


public int zoom = 14;

public int mapWidth = 640;

public int mapHeight = 640;


public enum mapType { roadmap, satellite, hybrid, terrain }

public mapType mapSelected;

public int scale;


IEnumerator Map()

{

url = "https://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap & markers = color:blue % 7Clabel: S % 7C40.702147,-74.015794 & markers = color:green % 7Clabel: G % 7C40.711614,-74.012318 & markers = color:red % 7Clabel: C % 7C40.718217,-73.998284 & key = ๋‚ด ๊ตฌ๊ธ€api key";

WWW www = new WWW(url);

yield return www;

img.texture = www.texture;

img.SetNativeSize();

}


// Start is called before the first frame update

void Start()

{

img = gameObject.GetComponent<RawImage>();

StartCoroutine("Map");

}


// Update is called once per frame




/* public RawImage kRawImg;


public string strBaseURL = "https://maps.googleapis.com/maps/api/staticmap?center=";

public double dLatitude = 37.4014171; // ์œ„๋„

public double dLongitude = 127.1102274; // ๊ฒฝ๋„

public int iMapZoom = 14;

public int iMapWidth = 640; // ๋ฌด๋ฃŒ ์ง€์› ์ตœ๋Œ€ ํ•ด์ƒ๋„

public int iMapHeight = 640; // ๋ฌด๋ฃŒ ์ง€์› ์ตœ๋Œ€ ํ•ด์ƒ๋„

public string strPath = "weight:3%7Ccolor:blue%7Cenc:{coaHnetiVjM??_SkM??~R";

๋‚ด ๊ตฌ๊ธ€api key"; // ๋ณธ์ธ์ด ๋ฐœ๊ธ‰ ๋ฐ›์€ API ํ‚ค ์ž…๋ ฅ(์—†์–ด๋„ ๋จ)


IEnumerator map()

{

string url = strBaseURL + dLatitude + "," + dLongitude +

"&zoom=" + iMapZoom.ToString() +

"&size=" + iMapWidth.ToString() + "x" + iMapHeight.ToString() +

"&path=" + strPath + strGoogleAPIKey;

Debug.Log("URL: " + url);

WWW www = new WWW(url);

yield return www;

kRawImg.texture = www.texture;

kRawImg.SetNativeSize();

}


// Use this for initialization

void Start()

{

kRawImg = gameObject.GetComponent<RawImage>();

StartCoroutine(map());

}


// Update is called once per frame

void Update()

{


}*/

}