x


embed google maps into unity 3d

Can I use www class or some other way to fetch and display google maps into unity?

more ▼

asked Jun 10 '10 at 08:34 PM

n0ob gravatar image

n0ob
90 5 6 9

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

It is possible to fetch and display Google Maps into your own applications (it's not against the Terms Of Use, as SpikeX said), but you have to go about it in the proper way - i.e. sign up for a Maps API key, and abide by the strict terms and conditions which define what you can & can't do with the data they provide.

So - you can't just embed or "screen scrape" the google maps web page. :-)

As for whether it would be possible to create a working implementation of Maps in Unity, I'm not sure. I have a hunch that it might be technically possible, but it would be a very large undertaking.

An easier way (if you're targeting the webplayer) might be to use one of the existing implementations in Flash, and switch between flash & unity on your web page so that users use the Flash app to browse/select your map, and then you send image data to your Unity app via in-page-Javascript commands. (this is all possible!).

more ▼

answered Jun 11 '10 at 10:11 AM

duck gravatar image

duck ♦♦
41k 92 148 415

how do you switch between a webpage and your unity app on a mobile device?

Apr 22 '11 at 07:03 AM ina
(comments are locked)
10|3000 characters needed characters left

Here's a simple implementation using Static Maps: 1) Create a plane, point the camera at it, add a light source

2) Add the following script to the plane

var url = ""; var lat : float; var lon : float; var li : LocationInfo;

function Start () { li = new LocationInfo();

lat = li.latitude; lon = li.longitude;

url="http://maps.google.com/maps/api/staticmap?center="+lat+","+lon+"&zoom=14&size=800x600&maptype=hybrid&sensor=true";

var www : WWW = new WWW(url); yield www;

renderer.material.mainTexture=www.texture;

}

You don't need the API key for it, and to my knowledge it doesn't violate ToS

more ▼

answered Jul 28 '11 at 07:01 PM

tokenshi gravatar image

tokenshi
31 4 4 6

unfortunately, unless you have a premier account, it is not allowed to use beyond the browser - for example, inside an app. decarta maps is an alternative though

Aug 08 '11 at 08:51 PM ina

i tried this and it work in the editor of unity but in android doesn't work, how i can make this work for android and ios?

May 21 '12 at 03:19 AM darkmax

just dont work at all.... unity needs google to add a crossdomain.xml. lol This is too bad. would have made unity a wonderfull thing for the web.

Jul 17 '12 at 05:37 PM pitibonom
(comments are locked)
10|3000 characters needed characters left

No, this is not possible, and I wouldn't recommend it, as it's against the Google Maps Terms of Use.

more ▼

answered Jun 10 '10 at 10:14 PM

qJake gravatar image

qJake
11.6k 43 78 161

it's not outright against the Terms Of Use to use Google maps in your own apps - but you have to sign up for a Maps API key and go about it the proper wya - and there are strict terms and conditions about what you can & can't do.

Jun 11 '10 at 10:12 AM duck ♦♦

Oh, I read somewhere else on here that this wasn't possible, and I wasn't sure about an API Key being used for inside a video game.

Jun 11 '10 at 08:47 PM qJake

currently, maps api key is not necessary for google maps static. however, unless you have a premier account, usage is only allowed within browser

Aug 08 '11 at 08:52 PM ina

So can you import a google map into unity or no?!?!?!?

Nov 02 '11 at 06:09 AM msnowai

any browser can, but unity don't.

Jul 17 '12 at 05:38 PM pitibonom
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x527
x53
x45
x40

asked: Jun 10 '10 at 08:34 PM

Seen: 11201 times

Last Updated: Jul 17 '12 at 05:38 PM