Google Earth for iOS / iPad, iPhone support for LookAt and Camera tags missing? - iphone

I've developed an app that pulls spatial data from an internal database, and generates a KML file. It consists of some styles, a document-level LookAt tag (for initial positioning), and a couple hundred placemarks with some custom CDATA in the baloons. When I import this into the PC application, it works perfectly, initially zooming to the correct position and altitude. When I load the same value using the Apple Google Earth app, it seems to ignore the LookAt tag, positioning itself in the middle of the placemarks at 1500ft. Below is the actual LookAt tag with xxx substituted for the valid latitude and longitude values.
<LookAt id="LastItem">
<longitude>xxx</longitude>
<latitude>xxx</latitude>
<altitudeMode>absolute</altitudeMode>
<altitude>5000</altitude>
<heading>0</heading>
<tilt>60</tilt>
<range>25000</range>
</LookAt>
Is this a feature that is not supported in the Apple version of the app? I've tried using Camera tags with the same effect.

The original Google Earth app for iOS devices DID support a document level <LookAt> or <Camera> - however at some point it stop doing so :( Instead it now defaults to a view situated 500m (or maybe ft) directly above and looking down at the center point of all the <Placemarks> in the first .kml loaded

Related

Unity Google Street View

I am trying to make a street view 360 viewer. Which should work on 2 screens.
One is a monitor and one is a oculus rift.
The first user will be sitting in front of the monitor and selecting street view images from a list / database.
The second user will wear the oculus rift and can see the street view images.
There is a plugin that can download panoramas from street view https://www.assetstore.unity3d.com/en/#!/content/28512 ,
but this will only work in the unity editor.
Well here is the problem. I need to update this programm once in a while. So maybe there will be new images every week, the user should be able to select them. If they start the programm, there will be a screen saying that there is an update available. The programm should than download all new images and after that, they will be available for the users.
So I am wondering if it is possible to download panoramas from street view in runtime? Like there will be a database with all url's to the panoramas, the programm will check that database, download all new one and convert them to skybox oder 6-sided pictures.
Thanks.
I am using unity 5.4 and it should work on a PC
You can download the images using the Google Street View API: https://developers.google.com/maps/documentation/streetview/?hl=en
Example URL:
https://maps.googleapis.com/maps/api/streetview?size=600x300&location=46.414382,10.013988&heading=151.78&pitch=-0.76&key=YOUR_API_KEY
Please not that the images will be 400px * 600px, to get higher resolution you'll have to pay.
You'll have to make a different request for each camera angle (the max allowed FoV is 120, meaning you'll need three images to make the whole horizontal circle).
Honestly, I would do the whole image managing and updating thing server side. I would set up an interface in the browser where you can add new interest spots, then the server downloads the images and creates the cubemaps. The Unity client will just ask the server for a list of all the interesting places and once you chose one it will download the cubemap. Maybe it's because I have a web dev background, but to me it makes more sense than doing everything inside Unity.

Showing a given location on a map in XCode (iPhone)

I am developing an app that will take in two locations from the user, one of which can be the standard 'current location', the second will be a location of the user's choosing. First of all, I simply want to plot these two locations on a map view.
Can anyone help me take a place name (e.g. Boston MA) from the user via a textfield and get the decimal coordinates as well as dropping a pin on the map?
Read the Location Awareness guide, especially chapter
UsingGeocoders
This will deliver a coordinate for given free text.
Further search in the Apple Developper Center for Demo code for that Geocoder.
Further there is a LocateMe demo code from Apple, which uses the map (MkMapKit)

iPhone MKMapKit Image Overlay

How can an image overlay be applied to a MKMapView? Basically, when you zoom in a specific location, I want an image to appear on top of the map that gives a more detailed view of the location.
I've had a look around and found different types of methods to use. I had a working example for an older SDK using the DrawMapRect function but this no longer seems to work on 4.2.
This is a good place to start...
http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKOverlayView_class/Reference/Reference.html
I was looking for polygon sample code though.
#omniscian: If you have solved it you should post something helpful for others. This page has a high google rank.

google map link with marker (on iphone & android)

I've tried to open Google Map application on iphone & android. From iPhone developer reference website I am able to open the native google map from link.
http://maps.google.com/maps?ll=11.5558762589,104.921697935&z=15
However, I have trouble with adding a marker into the map. As in google static map, we can add markers into map. I wonder if we can do the same to google map link.
Hey Borey
You can add markers. But it has to be google's own preset marker.
Try this link :
http://maps.google.com/?q=5.352135,100.299683&z=17
Use q instead of ll and I think it will work.
Problems I saw:
1) Cannot choose your own marker
2) Cannot remove that 'additional marker' that tells you what's around that area.
I guess, that's the next best thing for you? For your info, I am using it too as I lack other choices.
The only way I am aware of for doing this is to use the My Maps feature of google maps. You can create a public map in My Maps. Add a marker using the toolbar in the map, then use the link button on the top right to get the URL of your public map.
Not sure how this looks on a mobile device, but I assume that it works.
Edit
Ok. So my assumption was incorrect. I tried this out on Android and iPhone and got the following results:
iPhone - Switches out to the maps application (no option to view in the browser), displays the correct region, but no markers.
Android - Gives you the option of viewing the URL in the browser or in maps. If you view in the browser, you get the correct region, but no markers.
Android - If you view on the maps application, you get the correct region and the markers.
So basically not very useful to you. When I have done this in my mobile web apps (not native), I have used static maps. You give up the dynamic functionality, but you get lots of flexibility with what gets rendered on the map.

iPhone Direction Arrow?

I need to create an iPhone simple view that, based on the location of the user in the world, points the person to a never-changing Long/Lat location.
Is it possible to know this from the iPhone API?
Any examples?
This is possible on the current (3GS) iPhone, but not on earlier versions (which did not have a compass). The APIs that you'll need to use are in the CoreLocation.framework.
Search the app store for "mecca" and you'll turn up many, many applications that do exactly what you're asking about. You'll also find several applications that let you drop a pin anywhere on the map and have the app point you to it.
I've recently written code that does almost exactly what you describe.
Here's what you ned to do:
Calculate a heading from your current location to your target location. You should use "great circle" calculations, so they show a correct heading even when the destination is over the horizon. I found code (in Javascript) at this link to show me how to do this:
http://www.movable-type.co.uk/scripts/latlong.html
You want the section titled "bearing"
That code uses javascript library routines like "math.sin(x)" You can pretty much just delete the "math." part, and the trig functions work as is.
That will give you your bearing in radians.
You then need to get your compass heading (if on a 3Gs phone), convert it to radians, and use the compass heading to correct for the orientation of the phone. If you're running on a 3G, you can skip the compass heading and show the bearing based on North being at the top of the phone, and let the user orient their phone towards North themselves.
Duncan C