google-maps-markers

Google Maps Android API v2 detect long press on map and add marker not working

戏子无情 提交于 2019-12-06 18:49:57
问题 I want to add a marker on map with long press. Toast in onMapClick() was display with normal tap. But long press is not working. Toast in onMapLongClick() is not displayed with long press. Also marker is not displayed on map. I'm using SupportMapFragment because I want to use my application on Android 2.x devices. I have tested my app on Nexus One which has Android version 2.3.7. This is my code. public class MainActivity extends FragmentActivity implements OnMapClickListener,

How to hide current location in google map? [closed]

对着背影说爱祢 提交于 2019-12-06 17:12:36
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . I have implemented google map in my project and i want to hide my current location marker and i need to show the button which allow to go my current location. As the google provides current location button but i want to hide current location marker. I am attaching image the will more helps you in

Gradually fade out a custom, map marker

…衆ロ難τιáo~ 提交于 2019-12-06 17:12:14
问题 I'm trying to gradually fade out a custom Google map marker. I've seen all the posts that say to just use the drop in code from the DevBytes video and replace the setPosition with setAlpha, which is what I have attempted to do. The problem is that whatever I do, my icon just goes white for the duration of the handler and then transparent upon completion, instead of gradually fading to complete transparency. gMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() { @Override public

Google forEach map.data feature - return feature LatLng

馋奶兔 提交于 2019-12-06 16:41:52
I am trying to iterate through GeoJSON map.data using a forEach. I want to return the position (LatLng) of each feature so I can add it to my markers array based on a feature property. Here's my attempt: allMarkers = []; jQuery.getJSON('json.php', function(data){ points = map.data.addGeoJson(data); }); var eid = 30; map.data.forEach(function(feature){ if(feature.getProperty('eid') === eid){ LatLng = feature.getGeometry().LatLng; //not sure how to get LatLng id = feature.getProerty('id'); var marker = new google.maps.Marker({ position: LatLng, map: map, draggable: true, id: id, icon:

Drawing Circles / Polygons With Individual Delete Buttons in Google Maps API v3

自古美人都是妖i 提交于 2019-12-06 16:25:56
问题 This is to help people who have been trying to implement this or have been looking for this solution like I did for quite some time. Not being successful at finding an existing solution, I finally decided to do it. How to add a Delete Button or a X mark to a drawn shape (circle / polygon) so that individual shapes can be deleted using this button? 回答1: This is the Github Link to view the library and also a complete working example. On drawing a circle, a delete button (X mark) would be placed

Set marker icon on Google Maps v2 Android from URL

扶醉桌前 提交于 2019-12-06 15:39:42
I am unable to add the icon provided by the Google Places API to the marker. For example, I would like to have the icon returned from the JSON of Google Places API: "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png" Here's how I am doing it now without adding the icon: for (Place place : mNearPlaces.results) { LatLng placeLatLng = new LatLng(place.geometry.location.lat, map.addMarker(new MarkerOptions() .position(placeLatLng) .title(place.name)); } I looked at this post and the answer suggested using some AsyncTask to download the image. Is there any other way

How to track real time position using google map API?

隐身守侯 提交于 2019-12-06 15:22:51
问题 I am planning to implement a vehicle tracking system. Can anyone explain how do i track the position of an android device using Google maps API .. Also if it is not android device, how do i collect the live Geological position of a device (android/iPhone/windows) again only through Google maps API. Can someone please help me with this ? 回答1: Follow the steps:- You need to host a server which accepts latitude and longitude values seeded from android device you have to use google maps API also

how can handle double click on marker in android application

泪湿孤枕 提交于 2019-12-06 15:00:20
I am displaying a vehicles on a map,when i click on vehicle it shows info window but i need double click on vehicle then it will goes to the new page.I don't know how to do,please help me.here is my code public class MapsActivity extends FragmentActivity implements OnMapReadyCallback,GoogleMap.OnMarkerClickListener { GoogleMap mMap; RequestQueue requestQueue; ArrayList<LatLng> points = null; PolylineOptions polylineOptions; Geocoder geocoder; LocationListener locationListener; TextView tv,tv_one,tv_two; String string; @Override protected void onCreate(Bundle savedInstanceState) { super

toggle google maps markers by category

与世无争的帅哥 提交于 2019-12-06 14:50:27
问题 I am trying to get google maps to toggle markers. I am using an array to keep track of the markers and checkboxes to select which to get rid of. Here is some highlights of my code, I will paste the whole thing below. I tried to emulate the code in this link http://gmaps-samples.googlecode.com/svn/trunk/markerhider/markerhider.htm I cannot seem to get it to work.... Thank you for any and all help! variable var markerGroups = { "parking": [], "trail": [], "shelter": []}; load variable

Firefox & Google Map API v3 : IndexSizeError

我的梦境 提交于 2019-12-06 12:26:42
I've got some troubles since a few days or a few weeks with a Google Map (using v3) in Firefox 20.0 (works well in Google Chrome), whereas it worked well before. When I load the markers dynamically (loaded from database with Ajax), I have in my console (Firebug) : IndexSizeError: Index or size is negative or greater than the allowed amount (102 out of range 43) I thought that there was a link with scaling images (saw this post ), but it seems not. I've tried to set other width and height in second and fifth parameters of the MarkerImage. Same errors. Edit : I notice that when I don't precise