Posts

Showing posts with the label Google Maps

Android Studio - Google Map Still Blank On Real Android Device On Release Apk

Image
Answer : Make sure you enter your release API key in the google_maps_api.xml under the release folder. First, switch to Project view by using the dropdown in the upper left of the Project Explorer. Then, expand app/src/ , and you will see subfolders debug and release . Under there, you should see two separate google_maps_api.xml files under debug/res/values and release/res/values . Make sure that the release API key is in the google_maps_api.xml file under the release/res/values folder, since this is the one that will be used for the signed release apk. i was tired of trying over and over again, it turns out that PlayStore has something called App signing certificate , and the map works after i copy that sha1 and paste it in the google console for the android map. Go to https://play.google.com/apps/publish/ and then to App signing : Maybe you will see this: If that is the case, maybe you are a developer and not the account owner. You will have to contact the ac...

Can You Make A Travel Region Polygon With With Google Maps API?

Image
Answer : Google's tools do not provide any way to do this kind of thing built in. While you might be able to do this by routing to a sufficient number of locations and checking the time, another tool that you might be interested in is Graphserver. GraphServer is a multimodal trip planner, which can take data from OpenStreetMap and other data sources. Some of the gallery images show growing shortest-path distance routing, and this is based on a similar metric. The Google Group would be the appropriate place to discuss the possibilities of using this tool. Note that this is not a pre-baked tool; it will likely require some investigation and work to get it to solve your problem, but the tool can be used to do it. Take a look at the Mapnificent API. Mapnificent provides dynamic public transport travel time maps for many cities in the US and some world wide. You can use the Mapnificent API to augment your Google Maps application with public transport travel time ...

Adding Custom Property To Marker (Google Map Android API V2)

Answer : You cannot directly extend Marker , because it is a final class, but you have some options: 0) As of Google Maps Android API v2 version 9.4.0, you can use Marker::getTag and Marker::setTag . This is most likely the preferred option. 1) Create a map to store all additional information: private Map<Marker, MyData> allMarkersMap = new HashMap<Marker, MyData>(); When creating a marker, add it to this map with your data: Marker marker = map.addMarker(...); allMarkersMap.put(marker, myDataObj); Later in your render function: MyData myDataObj = allMarkersMap.get(marker); if (myDataObj.customProp) { ... 2) Another way would be to use Marker.snippet to store all the info as a String and later parse it, but that's kinda ugly and unmaintainable solution. 3) Switch from plain Google Maps Android API v2 to Android Maps Extensions. This is very similar to point 1, but you can directly store MyData into marker, using marker.setData(myDataObj)...

Adding Marker To Google Maps In Google-map-react

Answer : Edit: Since this answer was posted the docs (and likely, the API) of the GoogleMapReact element was changed to support children. Any child with lat and lng would be rendered at the corresponding location on the map, as also indicated by @Jobsamuel's answer. The onGoogleApiLoaded callback should not be used for this purpose, as it is inferior to the declarative style and would not be re-run if changes are made to the map. Original answer (outdated): This may not be entirely clear from the description in the Readme, but the maps argument is, in fact, the maps API object (and map is, of course, the current Google Map instance). Therefore, you should pass both to your method: onGoogleApiLoaded={({map, maps}) => this.renderMarkers(map, maps)} and use them: renderMarkers(map, maps) { let marker = new maps.Marker({ position: myLatLng, map, title: 'Hello World!' }); } Adding a marker on your map isn't as easy as we would like to, mo...