google-maps-markers

Rotate GMSMarker in direction at which user facing

走远了吗. 提交于 2019-11-29 01:06:22
问题 I have requirement like on my current location one view will display. It will rotate if device was rotate or location will be change.I research lot but got all the code which have a fix location or angle at some location but i haven't fix location. Can anyone drive me at right direction. I also used rotation property of the GMSMarker but it is not working. - (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { if (newHeading.headingAccuracy < 0){ NSLog

Removing Directions markers from the Google Maps API V3

纵饮孤独 提交于 2019-11-29 00:43:32
问题 To remove a normal marker from a map, I understand you simply call marker.setMap(null), but when implementing the Google Maps directions services, it automatically adds markers A and B onto the map ( calculating directions from point A to point B ). I do not have control over these markers, so I cannot remove them in the normal way. So how can I remove these markers (I have custom markers on the map instead)? 回答1: Set the suppressMarkers option to true when creating your DirectionsRenderer

Change Google Maps' Selected Marker or change marker's color? [iOS]

好久不见. 提交于 2019-11-29 00:37:44
I am wondering if there is a way to change the color or image of the selected marker and then change it back when it is not selected anymore. I see that Yelp, which uses Apple Maps, changes the color/image of the selected marker and then back to the original once that one is no longer selected and was wondering if the Google Map iOS SDK had something similar or if someone has come across this problem and found a solution. What I have tried: I have looked through Google's Documentation on Markers ( found here ) and see that they have marker.opacity which changes the opacity and marker.icon =

Event handler for editing a Google Maps Polyline?

家住魔仙堡 提交于 2019-11-29 00:33:22
问题 I'm looking for an event that fires while you are editing a Polyline in Google Maps, similar to the 'drag' event on Markers. I've found the 'capturing_changed' event, but it seems to fire on dragstart and dragend, not on drag. As is I'm having to reinvent the wheel by allowing a Marker to be dragged and updating the Polyline based on where the Marker is, basically reinventing editable Polylines. I'd like to be able to add Markers, which editable Polylines do smoothly, but I have to be able to

Picasso image loading issue in GoogleMap.InfoWindowAdapter

心已入冬 提交于 2019-11-28 23:59:14
I am using Google Maps Api and want to show an image inside InfoWindow when clicking of a Marker. I implemented it but there is a problem about Picasso. When I click a marker, infoWindow is shown up and imageView shows placeholder image. If I click same marker one more time, Picasso loads the image succesfully. I have to click twice, it is so weird. Screenshots for better understanding: First click on the marker: When I click again: There is my codes below: InfoWindowAdapter (Picasso loading here) mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() { @Override public View getInfoWindow

How to display custom places in Google Maps API search results?

只愿长相守 提交于 2019-11-28 23:55:33
So there is this basic example of a google map with a searchbox: https://developers.google.com/maps/documentation/javascript/examples/places-searchbox I want to accomplish something very simple. I'd like to just hardcode some locations (may be some simple array/object with their latitudes and longitudes) and then when you search for place, for example, "Washington", then those locations are displayed (with marker) if some of them are indeed inside Washington. If I search for "Africa" and some of my locations are inside africa, I want them to be displayed. And if I search for a place which has

Google Maps marker grouping

淺唱寂寞╮ 提交于 2019-11-28 23:44:14
I'm trying to achieve the following thing: Have different types of markers on my map for example, schools, libraries, bus stops and I want to be able to show/hide each group of markers. I have been searching google for a while but nothing came up :/ Any ideas how this can be achieved ? Daniel Vassallo There are various ways to tackle this, but let me show you one approach. First, let's start with an array of locations (borrowed from the Google Maps API Tutorials ): var beaches = [ ['Bondi Beach', -33.890542, 151.274856, 1], ['Coogee Beach', -33.923036, 151.259052, 1], ['Cronulla Beach', -34

What is the difference between “marker.setVisible(false)” and “marker.setMap(null)” in Google Maps v3?

孤人 提交于 2019-11-28 23:14:45
I want to clear a marker on Google Maps. What is the difference between marker.setVisible(false) and marker.setMap(null) ? But I don't know, which is right? The difference between the two methods does not seem to be clearly documented. However, note the following: When you use setMap(null) , your marker will lose the reference to the Map . If you do not keep a reference to the Map object, you wouldn't be able to reshow the marker. In addition, the setMap() method will not trigger the visible_changed event, while the setVisible() method does (if the visibility is actually toggled). Example: var

Google Maps API v3 remove all polylines

跟風遠走 提交于 2019-11-28 23:12:56
Little background. I have a navigation setup for when you click on a certain navigation item, it creates markers on the map. If you click on a different navigation item, it removes the previous markers and sets up new ones. Well now I am working with polylines and trying to create the same concept here with the polylines , however I am having a difficult time. Here is what I have: // Global variable for array of lines var points= []; Setup my points. line1 = new google.maps.LatLng(line1Start, line1Finish); line2 = new google.maps.LatLng(line2Start, line2Finish); line3 = new google.maps.LatLng

Automatically adjust zoom to accommodate all marker in a google map

一曲冷凌霜 提交于 2019-11-28 22:04:05
问题 Using the latest version of Google maps. How to add markers using longitude and latitude and automatically adjust the zoom level of the map to include all the markers using JavaScript? 回答1: Google Maps API v3 provides a LatLngBounds object to which you can add multiple LatLng objects. You can then pass this to Map.fitBounds() function as described here: Zoom-To-Fit All Markers, Polylines or Polygons on A Google Map - API v2 Zoom-to-Fit All Markers on Google Map v3 Partial Example var latlng =