how to set google map bounds to show all of earth - google-maps-api-3

Does anyone know how to set the bounds such that the map will show all of earth without duplicating continents? I've been beating my head against the wall trying to figure this out. Thank....

Hmmm, several people were asking about this (e.g. here and here) but I've never seen an answer. There are 2 subproblems which are both unsolved:
how to limit panning to some area
how to disable "repeating" the earth
You are probably concerned more by the second point. But I don't think this is reasonable to do. Imagine you live somewhere at the longitude 180 :-) - say you are at E179.99 then for panning few meters to east (or left) you would have to pan to the west through the whole world :-) The earth is round so I see it as a clear reason why google made it so...

Related

Pathfinding in isometric game with autotiles: How to modify NavigationMesh

Im generating a map proceduraly with isometric autotiles. Each tile has its navigation poligon defined in the Tilemap editor. The Navigationmesh is working fine. The thing is that the map I generate is bigger than the actually playable area. I dont want the human player to see the borders of the map, the "black background". So I'm limiting the camera view movement. Therefore, the navigationmesh goes outside of the playable area, like in this image:
I'm using pathfinding to move the player character. Since the map is generated proceduraly, sometimes it generates a map where the path to a point goes outside the playable area an then comes back in order to reach its destination. Like this:
A player in O would go outside the playable are to reach X. In X could be a point of interest, so if this kind of map is generated, I would simply regenerate it until i get a feasible one.
I'm using GODOT 3.51.
I have think about:
Carving a hole in the navigation mesh on the borders of the playable area using clip_polygons(). BUT since im using autotile navigation, it is very hard to get the navigationpoligoninstance. I have tried this but failed miserably.
-Adding NavigationObstacles on the borders: Hadn't tried this, but as far as i understand from my research, this will not avoid the agent to generate the path to the destination.
My idea is to achieve that no path goes out of the playable area and then check is the map is feasible by checking if all points of interest (randomly spawned) are reacheable. This is done by cheking the last point of every path to interest points from the starting point an seeing if it is equal to the point of interest position.
I hope this is understandable. Sometimes I dont understand myself.
What comes to mind is to use two versions of the tiles. One that is not passable which will be used to generate the areas that the players should not be able to reach. And the regular one used for the playable area.

Get nearest intersection using HERE Maps APIs

I want to measure the distance to the next intersection/traffic light based on a gps location(s).
I DON’T have a route (i.e. no destination point) but I can get gps locations every second (while on the move).
Is it possible to get the information using HERE APIs?
I understand that there is no direct way (specific api) to do it, but I would appreciate any idea that will fulfill my needs.
The general idea that I came up with was getting at least 2 gps points to understand the direction, then getting link_id for current location and try to get the next links in same direction/road and find if any of them are intersections...
I didn’t find a way to do it. Any ideas?
There is no direct API for this however there is an idea that you have to crawl along the link into the direction determined like you outlined (or better by sending the last few GPS points to our Route Matcher (aka RME)) until you reach an intersection.
And this can be achieved with a concept of "electronic horizon" in SDK. It takes your current road link and driving direction and then crawls forward over the upcoming links until an intersection comes (or even beyond taking the most probable choice). mobile SDK has this "electronic horizon" feature.
https://developer.here.com/documentation/android-premium/dev_guide/topics/electronic-horizon.html

Google Map Api - How to know if a coordinates is accessible by pedestrian

I'm trying to figure if there is a way to ask the Google Map Api to know if a random gps coordinates like :
48,277373
2,4883883
Is accessible by pedestrian ?
It should be possible because if I ask Google Map to lead me in the middle of a river, it will lead me just on the nearest point before the water.
But I'm not sure how about I can get this information by providing the coordinates.
Thanks for your help :-)

Procedural Road Generation, Unity

Im developing 2d isometric game. You driving car on city, thats all.
The issue is generating random maps with connected roads.
I would like to write script - i think i will be able to - but i cant find an idea for alghoritm itself.
Lets say i have 100x100 map, and i would like to build boolean table 1 is road 0 is not road.
As far i have solution that is drawing random number of lines (4-8 for ex) in horizontal and same vertical. But this road map is straight.
Can u share some ideas? Any will help
the question is too broad for a simple answer. theres plenty of ways in various degrees of complexity.
but as tip, consider the problem from a different perspective. sure in the end you want roads, but why are the roads there in the first place?
in your case its a city. a city consists of city blocks wich usually are rectangular. so one way would be to find a way to fill the map with rectangular shapes and consider the edges roads (or only some).
or you could look into triangulation algorithms and triangulate your map with a bunch of random points. then combine some triangles and use those edges as roads.
or even only use a random walk set up so it doesnt turn around completely.
or ...
... seriously though, the options and possible solutions are manifold and dependent on your skill level (as well as how you want to look your city in the end).
dont search for your specific problem, try to adapt some other algorithm for your need. theres plenty of tutorials on random dungeon generation for roguelike games.
also in the end there probably wont be a single generation algorithm giving you the best result, but a combination of many.

Google Maps API V3 -> Utilize MarkerCluster but have the clusters themselves be specific to a drawn polygon/region?

Ok, let me preface this question with the fact that I have created a lot of google maps, but they have been strictly markers and polylines denoting routes and a couple with some handler interaction.
Now I am looking to show basically a map of the world, mostly North America and I want to split this continent into my predefined regions with some lats/lngs that I have. Using these regions I want to draw something like a polygon with a light opacity and different color per region.
I then want to use marker clustering but I want the clusters to be specific to these regions. I have looked around but I haven't found an example like this. I have seen pages that say you can do this but not how you would go about doing this. Again, I am definitely a noob when it comes to drawing polygons and using the marker cluster. I know this question is fairly vague but just looking for an example/idea to start off of, and more so I don't want to write a bunch of code against this specific api and then find out that it is not possible.
Any ideas or suggestions are greatly appreciated....Thanks.
It can be done, but will require a rewrite of the MarkerClusterer (probably will simplify it).
You will need to determine how you are going to represent and load the cluster boundary polygons (KML, GeoJSON, native Google Maps API v3 polygons) and probably use the google.maps.geometry.poly.containsLocation(point:LatLng, polygon:Polygon) instead of LatLngBounds.contains to determine which cluster "owns" a marker.

Resources