Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
7
Question by n0ob · Jun 10, 2010 at 08:34 PM · wwwgooglemapsembed

embed google maps into unity 3d

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

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Trahbo · Jan 20, 2015 at 02:08 PM 0
Share

hello all, what i recently found, when you use:

url="http://maps.google.com/maps/api/staticmap?center=53.01,18.6&zoom=13&size=800x600&type=hybrid&sensor=true";

you get retrieval error, as it fails security restrictions. what is also known, .jpg, .png etc, types are allowed.

which lead me to succesfuly using:

url="http://maps.google.com/maps/api/staticmap?center=53.01,18.6&zoom=13&size=800x600&type=hybrid&sensor=true?a.jpg";

adding "?a.jpg" does not spoil google maps query and bypasses unity player security :)

full example code, just attach jscript to plane :)

=====================================

pragma strict

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=53.01,18.6&zoom=13&size=800x600&type=hybrid&sensor=true?a.jpg";

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

renderer.material.mainTexture=www.texture;

}

4 Replies

· Add your reply
  • Sort: 
avatar image
8
Best Answer

Answer by duck · Jun 11, 2010 at 10:11 AM

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!).

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ina · Apr 22, 2011 at 07:03 AM 0
Share

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

avatar image tanoshimi · Jan 20, 2015 at 02:25 PM 0
Share

It's worth mentioning that some of those terms of use by which you must abide are pretty restrictive.... including:

  • 9.1.1a) Free Access (No Fees). Your $$anonymous$$aps API Implementation must be generally accessible to users without charge and must not require a fee-based subscription or other fee-based restricted access. This rule applies to Your Content and any other content in your $$anonymous$$aps API Implementation.

  • 10.1.3a) No Unauthorized Copying, $$anonymous$$odification, Creation of Derivative Works, or Display of the Content. You must not copy, translate, modify, or create a derivative work (including creating or contributing to a database) of, or publicly display any Content or any part thereof except as explicitly permitted under these Terms. For example, the following are prohibited: (i) creating server-side modification of map tiles; (ii) stitching multiple static map images together to display a map that is larger than permitted in the $$anonymous$$aps APIs Documentation;

  • 10.1.3b) You must not pre-fetch, cache, or store any Content.

  • 10.2d) No Navigation, Autonomous Vehicle Control, or Enterprise Applications. You must not use the Service or Content with any products, systems, or applications ... synchronized to the position of a user's sensor-enabled device.

So, you can't charge for a game that uses Google $$anonymous$$aps, you can't alter the imagery at all to match the style of your game, you have to re-download all the map data from Google every time you play a game, and you can't use it for Augmented Reality apps that make use of a mobile devices' GPS/compass etc....

avatar image MFKJ · Dec 01, 2015 at 09:53 AM 0
Share

@duck Can i show complete google earth map on sphere? http://stackoverflow.com/questions/34017284/show-complete-interactive-google-map-on-sphere-globe

avatar image
5

Answer by tokenshi · Jul 28, 2011 at 07:01 PM

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↦type=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

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ina · Aug 08, 2011 at 08:51 PM 0
Share

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

avatar image darkmax · May 21, 2012 at 03:19 AM 1
Share

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?

avatar image pitibonom · Jul 17, 2012 at 05:37 PM 0
Share

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.

avatar image ShawnFeatherly · May 23, 2015 at 12:46 AM 0
Share

The free asset store package "Google $$anonymous$$aps for Unity" also uses staticmap. https://www.assetstore.unity3d.com/en/#!/content/3573 Works in Unity 4.6.5f1 using the fixes from "philipho"'s review of the package.

avatar image
-2

Answer by qJake · Jun 10, 2010 at 10:14 PM

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

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image duck ♦♦ · Jun 11, 2010 at 10:12 AM 2
Share

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 $$anonymous$$aps API key and go about it the proper wya - and there are strict terms and conditions about what you can & can't do.

avatar image qJake · Jun 11, 2010 at 08:47 PM 0
Share

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

avatar image ina · Aug 08, 2011 at 08:52 PM 0
Share

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

avatar image msnowai · Nov 02, 2011 at 06:09 AM 0
Share

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

avatar image pitibonom · Jul 17, 2012 at 05:38 PM 0
Share

any browser can, but unity don't.

avatar image
0

Answer by tarasfromlviv · Oct 28, 2018 at 07:02 PM

My plugin Google Maps View does exactly this: https://assetstore.unity.com/packages/tools/integration/google-maps-view-82542

Works on Android and on iOS. It is a native view so the performance is great. The only limitation is that you can't display Unity scene objects on top of it.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Google Insights 0 Answers

How do you constrain googleMaps to a window? 0 Answers

how to enter another request from www with c# 1 Answer

GoogleApiException: Parameter "spreadsheetId" is missing 2 Answers

Google Maps SDK CORS policy is breaking my WebGL build 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges