|
Can I use www class or some other way to fetch and display google maps into unity?
(comments are locked)
|
|
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!). 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)
|
|
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 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)
|
|
No, this is not possible, and I wouldn't recommend it, as it's against the Google Maps Terms of Use. 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)
|
