drawing a path between two cities on google static map - google-maps-static-api

I want to draw a path between two cities on a google static map along a road according to a suggested route of google map.when I used path attribute with pipe characters I can draw a line but not along a road. for drawing it along a road suggested by google map what should i do?is that possible on google static map?

You can definitely do this with the Static Maps API:
get directions using DirectionsService:
http://code.google.com/apis/maps/documentation/javascript/reference.html#DirectionsService
and convert the overview path to suit the requirements of the Static Maps API:
http://code.google.com/apis/maps/documentation/staticmaps/#Paths

Related

How do i fix crossing polylines on google maps flutter

I'm using the official Google Maps Flutter plugin & the google directions API to show maps and draw polylines and it works perfectly fine until I start drawing complex polylines.
The problem is polylines are not following the correct lanes on some specific roads.
Here is an example
Is there a way I can make that a single line?
I have tried removing duplicate PointLatLan from the list of polylines I used, but it got worse.
If you have an idea on how to fix this || you need more information regarding this question. Your help is appreciated.
Thanks

Mapbox Static API - How to use custom markers in GeoJSON overlay?

The docs say it's possible so I'm obviously missing something. So far I've tested different variations of marker-url and url- in the Mapbox playground with both single point and feature collections (as shown in the examples) but all I'm getting are the generic markers.
Any guidance to point me in the right direction?
https://api.mapbox.com/styles/v1/mapbox/streets-v11/static/geojson({"type":"FeatureCollection","features":[{"type":"Feature","properties":{"url-":"http%253A%252F%252Fwebsite.com%252Ffiles%252Fmarkers%252Fgreenpin.png"},"geometry":{"type":"Point","coordinates":[-122.2599,37.8098]}},{"type":"Feature","properties":{"url-":"http%253A%252F%252Fwebsite.com%252Ffiles%252Fmarkers%252Fgreenpin.png"},"geometry":{"type":"Point","coordinates":[-122.2591,37.8062]}},{"type":"Feature","properties":{"url-":"http%253A%252F%252Fwebsite.com%252Ffiles%252Fmarkers%252Fgreenpin.png"},"geometry":{"type":"Point","coordinates":[-122.2565,37.8063]}}]})/-122.2647,37.8006,12,0/1080x1080#2x?access_token={token}
This is not reflected in the official documentation, but in order to use a custom marker with a geojson overlay, you can rely on the marker-url property for your features.
If you update your request to the API to the following, you should achieve the desired result:
https://api.mapbox.com/styles/v1/mapbox/streets-v11/static/geojson({"type":"FeatureCollection","features":[{"type":"Feature","properties":{"marker-url":"http%253A%252F%252Fwebsite.com%252Ffiles%252Fmarkers%252Fgreenpin.png"},"geometry":{"type":"Point","coordinates":[-122.2599,37.8098]}},{"type":"Feature","properties":{"marker-url":"http%253A%252F%252Fwebsite.com%252Ffiles%252Fmarkers%252Fgreenpin.png"},"geometry":{"type":"Point","coordinates":[-122.2591,37.8062]}},{"type":"Feature","properties":{"marker-url":"http%253A%252F%252Fwebsite.com%252Ffiles%252Fmarkers%252Fgreenpin.png"},"geometry":{"type":"Point","coordinates":[-122.2565,37.8063]}}]})/-122.2647,37.8006,12,0/1080x1080#2x?access_token={token}
Disclaimer: I currently work at Mapbox

Google map still loading when animating locations

I want to animate google map from one place to another. I use following code to do this;
final GoogleMapController controller = await _controller.future;
controller.animateCamera(CameraUpdate.newCameraPosition(_endPlace));
The animation works fine. But when I move to the new location the map take some time to load at the new location.
Is there a way to pre load the maps needed along the animation path?
Its not about exactly flutter, but one of technically possible way is to use TileProvider with local preloaded (or loaded in separate threads) tiles files like in this answer. Tiles you can get via URL like that:
http://mt1.google.com/vt/lyrs=m&x=91&y=53&z=7
More about tile coordinates you can find here.
Also read carefully General information and Google Maps Terms of Service especially:
b. copy the content (unless you are otherwise permitted to do so by the
Using Google Maps, Google Earth, and Street View permissions page or
applicable intellectual property law, including "fair use");
c. mass download or create bulk feeds of the content (or let anyone else
do so);
because Google don't allow that. May by OSMDroid is better for you.

QR code format for geolocation

I am developing a QR code generator where I need to make QR code codes for various datas. One of them is geolocation and social network (likes in Facebook and follow in Twitter).
I am okay with other formats however the above two items are still not clear to me. What is the specific format to get them done?
A geo URI may be used to encode a point on the earth, including altitude. For example, to encode the Google's New York office, which is at 40.71872 deg N latitude, 73.98905 deg W longitude, at a point 100 meters above the office, one would encode "geo:40.71872,-73.98905,100".
A reader might open a local mapping application like Google Maps to this location and zoom accordingly, or could open a link to this location on a mapping web site like Google Maps in the device's web browser.
Please follow the specific format.
QR codes store alphanumeric data. If you can write code able to read them (or integrate a third part library) you can do whatever you want with them, e.g. you can store coordinates in Well Known Format WKF
To like something from a QR code please refer to this answer: Facebook page automatic "like" URL (for QR Code)
Normally, Existing qr code readers expect an url.
With regard to the supported devices: all depends on the libraries used to read the qrcode, it does not depends on the device itself.
For a geolocation, expressed as latitude, longitude coordinate i would code this way:
uncoded coordinate in degrees WGS84: lat=48.123456 lon=-120.123456
for coded string multiply each coord with 1E6:
string reprsentation: "(48123456,-120123456)"
I implement a lat and lng coordinates map qr code on my qr code generator http://www.qrcode-generator24.com. Put the marker on the google map and the coordinates will be stored in a form like lng:39.7676745 lat:20.7634834. Bear in mind that not all qr code reader are able to recognize that content as map coordinates.
I did it by geo:lat(numerical value),lang(numerical value) to bring up the geo location qr code and it works good in any scanner.

Is there any easy way to duplicate the search functionality of the Google Maps app on iPhone?

I'd like to be able to search and have the results pop up as annotations just like the Maps app on the iPhone. How do I go about doing it, and how difficult is it?
You need a forward geocoder to take a string (from your search bar) and find a list of possible matches, with coordinates and such. ... there isn't one included with the MapKit (only a reverse geocoder -- from coordinates to address string). However, there's a few services out that that do this. I think GeoSimple, CloudMaps, and a few others. The one linked below is an objective-c package that pulls results from Google Maps SDK.
http://blog.sallarp.com/ipad-iphone-forward-geocoding-api-google/