google-maps-markers

Save markers on Android google maps v2

[亡魂溺海] 提交于 2019-12-03 15:49:29
I am using Android Google maps v2 API and have it set up to add markers on long click. I need a way to save these markers and reload them when the app resumes again. What will be the best way to do this? Please help Currently I add markers as follows: map.addMarker(new MarkerOptions().position(latlonpoint) .icon(bitmapDescriptor).title(latlonpoint.toString())); CrashOverride I got it! I can easily do this via saving the array list of points to a file and then reading them back from file I do the following onPause : try { // Modes: MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITABLE

How can i access all marker on my GoogleMap-Object (android maps v2) and set them (in)visible?

谁说我不能喝 提交于 2019-12-03 15:14:36
问题 i am currently trying to implement an ActionBar-Button that on usage sets all my markers on my GoogleMap-object visible or invisible. My problem is that i don't know how i can get a reference to all my markers once they have been created and are shown on my map. Im looking for a solution where i stash all my marker-objects into an array, that i can access in other parts of my code aswell. is this approach reasonable? here is what i am thinking of: private Marker[] mMarkerArray = null; for

How to change icon on Google map marker

末鹿安然 提交于 2019-12-03 15:06:18
问题 I want to use my customize icon on Google map, and added icon url on the code. But it's still not reflecting on the map. Can anyone suggest, what i am missing here. Why icon is not changing, after adding the icon url "http://google-maps-icons.googlecode.com/files/sailboat-tourism.png". <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> var markers = [ { "title": 'This is title', "lat": '-37.801578', "lng": '145

Can I change the marker in a Google Maps embedded map (iframe)?

两盒软妹~` 提交于 2019-12-03 14:52:52
问题 I know I can do it with the Google Maps API, but do you know if there is a way to change the marker in an embedded Google Map? I want to replace the default "A" button for a "B" button or the marker with just a dot in the middle. 回答1: I haven't played around with embedding Google Maps before (I generally go straight to the API for stuff like this). I tried a couple of approaches: I figured maybe the embed syntax would be the same as the static maps api. So I grabbed a static maps URL, copied

Using google street view with a marker, how do I point the POV at a marker?

扶醉桌前 提交于 2019-12-03 14:51:44
I have a simple street view working to show me a street view given an address: var geocoder = new google.maps.Geocoder(); var address = "344 Laguna Dr, Milpitas, CA 95035"; geocoder.geocode( { 'address': address}, function(results, status) { //alert (results); if (status == google.maps.GeocoderStatus.OK) { //alert(results[0].geometry.location); myStreetView = new google.maps.StreetViewPanorama(document.getElementById("map_canvas")); myStreetView.setPosition(results[0].geometry.location); var marker = new google.maps.Marker({ position: results[0].geometry.location, map: myStreetView, title

GMSMarker opacity animation not repeating

谁说胖子不能爱 提交于 2019-12-03 14:27:30
I'm trying to make a GMSMarker with a custom icon blink with a decaying animated opacity. The animation should repeat itself for a few times, but it does not, it just performs one transition and then it stops. This only happens when animating the opacity property, it works fine when animating other properties. Here is the code: GMSMarkerLayer* layer = marker.layer; CABasicAnimation *blink = [CABasicAnimation animationWithKeyPath:@"opacity"]; blink.fromValue = [NSNumber numberWithFloat:0.0]; blink.toValue = [NSNumber numberWithFloat:1.0]; blink.duration = 1.0; blink.autoreverses = YES; blink

Drag & drop an object into Google Maps from outside the map : marker not put at correct latitude / longitude

与世无争的帅哥 提交于 2019-12-03 14:25:14
I'd like to drag an object into my Google Map (API V3) from outside the map. After some research, I found this very helpful post and I tried to adapt it to my project. The main idea is to drag a .png image on the map and when the mouse button is down, get the actual coordinates and place a marker at that lat / lng. But I noticed there is a difference between the point you drag your image and the point where your marker is placed. The difference is around 10 / 15 pixels on the sample linked above, regardless the zoom level. At max zoom, it's not very important, but the more you unzoom, the more

Add multiple geopoints and markers automatically in Google Maps

半世苍凉 提交于 2019-12-03 14:14:51
问题 Is it possible to make the addition of a geopoint in a map more "automatic"? I mean, if we have many points to add in the map (more than 100), we don't have to add them one by one like that: GeoPoint point2 = new GeoPoint(microdegrees(36.86774),microdegrees(10.305302)); GeoPoint point3 = new GeoPoint(microdegrees(36.87154),microdegrees(10.341815)); GeoPoint point4 = new GeoPoint(microdegrees(36.876093),microdegrees(10.325716)); pinOverlay.addPoint(point2); pinOverlay.addPoint(point3);

Using Google Places Search Box. How to initiate a search by clicking a button?

血红的双手。 提交于 2019-12-03 12:36:12
Either I am an idiot or this was an egregious oversight on the part of the Google Maps team. I am attempting to trigger a places search request on a button click event in conjunction with the standard enter keypress event (which is currently working fine). I have combed through the documentation related to the Google Places search box and have found no sutiable solution. Because of confidentiality reasons I am using the example from the demo. function initialize() { var map = new google.maps.Map(document.getElementById('map-canvas'), { mapTypeId: google.maps.MapTypeId.ROADMAP }); var

Remove previous Marker and add new Marker in Google Map v2

独自空忆成欢 提交于 2019-12-03 12:01:05
问题 I want to remove a current marker after long click on map anywhere and recreate a new marker at that point. I have cleared google map on long click on map and new marker is created but the previous marker also displayed. My Code is: public class EditLocation extends Fragment { View v; Context c; GoogleMap MAP; Button back; int loc; String lat; boolean isTapped = true; public EditLocation(Context c, int location, String latitude) { // TODO Auto-generated constructor stub this.c = c; this.loc =