Can Google Maps show Terrain at 45 degrees - google-maps-api-3

I need the terrain view but cant seem to show it at 45 degrees. I dont want to use the google earth plug-in though. Can this be done? If not: are there other map apis that do this?

It can't be done with Google Maps API. Tilted maps are only available with the satellite/aerial tiles.
The docs state "setTilt(): Sets the angle of incidence for aerial imagery (available for SATELLITE and HYBRID map types) measured in degrees from the viewport plane to the map plane. The only supported values are 0, indicating no angle of incidence (no tilt), and 45 indicating a tilt of 45deg."

Related

Get coordinates of a certain street to be able to highlight the street in the map view (Here Maps)

I'm using the Here Maps JS SDK from a Web Application and I'd like to highlight a certain street. The highlighting itself can be made using a polyline but how do I get the geo coordinates of this street? I looked through the docs of the various HERE Maps REST APIs but couldn't find any solution yet.
To get the geo coordinates of this street you can use our HERE Fleet Telematics API (Data Extension part - PDE) you can read the documentation on https://developer.here.com/documentation/platform-data/dev_guide/topics/request-constructing.html
You can get a road geometry from ROAD_GEOM_FCn (where n is 1..5) layer (maybe you need also data from ROAD_ADMIN_FCn,ROAD_NAME_FCn layers), to get description of all layers please see on https://tcs.ext.here.com/pde/maps?url_root=pde.api.here.com
The example request could be like: PDE request example
You can compute the tile ID(tilexy) for a given coordinate and layer as follows:
tile size = 180° /2level [degree]
tileY = trunc((latitude + 90°) / tile size)
tileX = trunc((longitude + 180°) / tile size)
See please examples code on:
https://tcs.ext.here.com/examples/v3.1/pde_street_details
https://tcs.ext.here.com/examples/v3/pde_street_details

How can I apply different normal map textures for different faces of a minecraft-like cubic terrain blocks in Unity?

I'm making a procedurally generated minecraft-like voxel terrain in Unity. Mesh generation and albedo channel texturing is flawless; however I need to apply different normal map textures for different cube faces regarding whether they're neighboring to another cube or not. Materials accepts only single normal map file and doesn't provide a sprite-sheet-editor kind of functionality for normal maps. So I have no idea about how to use selected slices out of normal map file as if they were albedo textures. I couldn't find any related resources about the problem. Any help will be appreciated. Thanks...
First of all, I'm not an expert in this area, though I am going to try to help you based on my limited and incomplete understanding of parts of Unity.
If there are a finite number of "normal face maps" that can exist, I suggest something like you indicated ("sprite sheet") and create a single texture (also sometimes called a texture atlas) that contains all these normal maps.
The next step, which I'm not sure whether the Standard material shader will be to handle for your situation is to generate UV/texture coordinates for the normal map and pass those along with your vertex xyz positions to the shader. The UV coordinates need to be for each vertex of each face; they are specified as a 2-D (U, V) offset into your atlas of normal maps and are floating point values with a range of [0.0, 1.0], that map to the full X and Y coordinates of the actual normal texture. For instance, if you had an atlas with a grid of textures in 4 rows and 4 columns, a face that should use the top-left texture would have UV coords of [(0,0), (0.25,0), (0.25,0.25), (0, 0.25)].
The difficulty here may depend if you are you using UV coordinates for doing other texture mapping (e.g. in the Albedo or wherever else). If this is the case, I think the Unity Standard Shader permits two sets of texture coordinates, and if you need more, you might have to roll your own shader or find a Shader asset elsewhere that allows for more UV sets. This is where my understanding of gets shaky, as I'm not exactly sure how the shader uses these two UV coordinate sets, and whether there is some existing convention for how these UV coordinate are used, as the standard shader supports secondary/detail maps, which may mean you have to share the UV0 set with all non-detail maps, so albedo, normal, height, occlusion, etc.

turf.js / turf.buffer and Google Maps API

I have a simple Google Map. I've added a marker at a given lat, lng.
I want to use turf.js to calculate a 1km buffer which I can then display as a Google Maps polygon.
The path that turf.buffer() returns is an ellipse. The distance from the marker to the boundary is correct latitudinally. However it is short of 1km longitudinally. It looks like there is a problem with the projection, however both the Google Maps API and turf.js documents state WGS84 is the default projection.
The end game is using turf.js to buffer Points, Polylines and Polygons so I can't just draw a Google Maps circle as a workaround unfortunately. I would consider migrating to Leaflet, however we are already quite invested in developing for the Google Maps API
I've created an htm file here showing the problem
I'm not going nuts. The buffer isnt geodesic so at the equator you get a round buffer and as you move north or south your buffer becomes squashed longitudinally towards the poles. The turf.js team are aware. See https://github.com/Turfjs/turf/issues/110 for full details.
I'm looking at using clipper.js instead. This is a cartesian library (2d) so in the uk i can use osgb eastings and northings. I will also have to flip north and south as clipper assumes we are dealing with standard graphics i.e. The y axis is inverted like in css with 0,0 being the top left.
Im going to use geotools to transform between osgb and wgs.

zoom 18 projection

I have written a tile image generator for use with overlay.getTileUrl(tileCoord,zoom) that works as expected for map type Road_Map for zoom levels to 21
function tile2lng(x,z) { return (x/Math.pow(2,z)*360-180); }
function tile2lat(y,z) { var n=Math.PI-2*Math.PI*y/Math.pow(2,z);
return (180/Math.PI*Math.atan(0.5*(Math.exp(n)-Math.exp(-n)))); }
at lat/lng 37.21 / -77.26
When the Satellite map is zoomed to level 18 the tile coordinates for the requested overlay tile calculate to lat/lng 27.37 / -77.26
Actually, there seem to be two passes at loading the map. First tile lat/lng is requested correctly, then a Projection_Changed event occurs, and then tiles are re-requested with lat/lng calculated incorrectly. It seems the projection for Satellite tiles displayed at map zoom 18 to 21 is not the standard Google mercator projection. How should this change be detected by overlay.getTileURL(coord,zoom) ?
What is the proper way to calculate lat/lng for Satellite tiles when map zoomed 18 to 21 ?
And the answer is: at this time, there are no exposed projection parameters.
What I really needed:
map.setTilt(0);
I did not realize Google Maps automatically rendered satelite zoom 18 and higher with tilt set at 45 which changes the standard base map projection.
Happy days!

Plotting lat/lon points on Apple Maps vs Google Maps

I'm using Google Places to get latitude and longitude for places near a user, and then plotting those points on both Apple Maps (on iOS 6, using MKMapView) and plotting them on Google Maps (using Javascript V3). Now the problem is when I plot them on MKMapView the points are not in their correct positions, while on Google Maps they are. Why is this the case? Shouldn't plotting a latitude/longitude point on a map make it have the same point?
The points are the same. However The image overlays are going to be different. This could be due to the angles that the images where taken at, an we all know that Apple is having some small issues fixing there mapping program. I hope this helps.

Resources