Reputation: 7906
Is there a way to display Google Maps (even other maps should be ok) in Unity 3D but on mobile devices (both Android and iOS)?
Even paid plugins are ok.
Upvotes: 4
Views: 14322
Reputation: 1875
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.
Upvotes: 0
Reputation: 2179
Some time ago, I started to work on map based framework for unity3d: ActionStreetMap. The current version (0.7) supports the following features:
You can find web demo builds here.
Upvotes: 1
Reputation: 4056
You can use Unity's WWW.texture and Google's static maps API to render their map as a texture on a GameObject. For my example I used a plane, nothing fancy. The image URL I used in my example was taken directly from the Google API page. One note, you'll need to use your own API key, I've left that value blank. If you run my example without the API key, you'll get a 403 error.
using UnityEngine;
using System.Collections;
public class GoogleMaps : MonoBehaviour {
string exampleUrl = "http://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%7Ccolor:red%7Clabel:C%7C40.718217,-73.998284"+
"&sensor=false";
string key = "&key=YOUR_API_KEY"; //put your own API key here.
IEnumerator Start() {
WWW www = new WWW(exampleUrl+key);
yield return www;
renderer.material.mainTexture = www.texture;
}
}
Upvotes: 5