google-maps-markers

Android Google Maps v2 - Add object to marker

落爺英雄遲暮 提交于 2019-11-30 06:01:52
How can we add an object to a marker in the new Google Maps Android API v2 ? So if we click on the InfoWindow , we can do something with the object? public void addSpotOnMap(Spot spot) { getMap().addMarker(new MarkerOptions() .position(new LatLng(spot.getParseGeoPoint().getLatitude(), spot.getParseGeoPoint().getLongitude())) .title(spot.getName()) .snippet(spot.getCategory()) .draggable(false)); } This sets the location, title and snippet for the object. But I want to be able to go to another activity about this specific Spot-object if I click on the InfoWindow Not really sure if this is the

Grey area in Google maps

放肆的年华 提交于 2019-11-30 04:16:54
问题 I have implemented Google maps in my app (in a modal), however as you can see on the images below there is a grey area that I of course want to get rid of. It is possible to move the map so that the grey area disappears, but that shouldn't be needed. Thing is that the map is shown inside a modal box, which contains of a lot of content that's dynamically created when the button for showing the modal is clicked. It seems that the problem could be that the map content isn't fully loaded before

Event handler for editing a Google Maps Polyline?

六眼飞鱼酱① 提交于 2019-11-30 03:37:13
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 detect on drag. I can't find anything in the API documentation or on a Google search, so I thought I'd

Removing Directions markers from the Google Maps API V3

眉间皱痕 提交于 2019-11-30 03:30:31
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)? Set the suppressMarkers option to true when creating your DirectionsRenderer object and then the markers won't show up. You could also change the style or icon of the markers. See the API

Rotate GMSMarker in direction at which user facing

落花浮王杯 提交于 2019-11-30 03:28:59
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(@"heading accuracy < 0"); return; } // Convert Degree to Radian and move the needle float oldRad = (-

Google map API v3 markers overlapping

假如想象 提交于 2019-11-30 02:42:08
问题 I am making an application with google maps. When markers are overlapping only the last one is displayed even if the icons are different.. I do not want it to cluster in that case, rather it should show both maybe by changing the coordinates just a but?? Any solutions?? 回答1: I think this is a pretty elegant solution, called Spiderfying the markers. https://github.com/jawj/OverlappingMarkerSpiderfier I'm thinking of using it. What I do now is use JavaScript to make a fancy popup that hides and

Android, How to remove all markers from Google Map V2?

别来无恙 提交于 2019-11-30 01:15:33
I have map view in my fragment. I need to refresh map and add different markers based on condition. So, I should remove last markers from map before add new markers. Actually, some weeks ago app was working fine and suddenly it happened. My code is like this: private void displayData(final List<Venue> venueList) { // Removes all markers, overlays, and polylines from the map. googleMap.clear(); . . . } Last time it was working fine (before new Google Map API announce by Android team in I/O 2013). However, after that I adapted my code to use this new API. Now, I don't know why this method

Maps API v2 with different marker actions

丶灬走出姿态 提交于 2019-11-30 01:05:09
I'm trying to port my application to the new Google Maps API v2, but i'm having trouble when interacting with markers. My context: I have a map showing buses and buses stop. With the old library I had my own ItemizedOverlay for bus stops and another one for buses. Each one had a different OnTapListener (actually I use an external library to show balloons), so when the user taps the bus marker nothing happens, but when he taps the bus stop marker an activity with its information is opened. Also, in my ItemizedOverlay I mapped each marker with its bus stop object of the model. Now with the new

Google Maps v3: need multiple draggable markers to update HTML input fields

冷暖自知 提交于 2019-11-29 21:48:24
问题 I'm working on a project using Google Maps v3 that will allow users to drag and drop randomly placed markers (quantity, coordinates, and labels generated with php). I would like the latitude and longitude of moved markers to update html input fields on the page. Unfortunately, I do not know enough about js to give each marker a unique identity in an efficient way by using arrays and/or 'variable variables'. Here is my code thus far: <!DOCTYPE html> <html> <head> <meta name="viewport" content=

Google maps open info window by default?

柔情痞子 提交于 2019-11-29 20:36:56
The following example shows a simple Marker (standard icon) on Google maps for the location and when clicking the icon, it opens the info window. Can I show the info window open by default so that I don't need to click the icon to open? var myLatlng = new google.maps.LatLng(-25.363882,131.044922); var myOptions = { zoom: 4, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var contentString = '<div id="content">'+ '<div id="siteNotice">'+ '</div>'+ '<h2 id="firstHeading" class="firstHeading">Uluru</h2>'