google-maps-markers

Draw polygon using onMarkerDrag google map v2

不羁的心 提交于 2019-12-12 03:11:50
问题 I'm trying to draw a free form lines over google map v2, so I'm trying to do this by listening to marker drag. I wrote the following code but it doesn't draw anything @Override public void onMarkerDrag(Marker marker) { Integer markerId = markerMapHash.get(marker); // as I'm giving every marker a key by HashMap if (markerId == 1) { System.out.println("this is the draw line marker: "+marker.getPosition()); lineCordinates.add(marker.getPosition()); // lineCordinates is an arrayList } for (int i

How to make a link clickable in a Google Map Marker InfoWindowAdapter

妖精的绣舞 提交于 2019-12-12 03:08:10
问题 I'm displaying a couple of markers on a Google Map. When I click on a marker it opens a custom InfoWindowAdapter this.map.setInfoWindowAdapter(new CustomInfoWindowAdapter(getLayoutInflater())); In this CustomInfoWindowAdapter I display some text and create a link when a phone number is found: @Override public View getInfoContents(Marker marker) { if (this.popup == null) { this.popup = inflater.inflate(R.layout.poi_marker, null); } TextView tv = (TextView) popup.findViewById(R.id.title); tv

Set Camera focus on particular marker on google map on listview item click

三世轮回 提交于 2019-12-12 02:52:59
问题 What i want : I want to set focus on marker that is already placed in google map. When i click on list view item , focus of camera should be transfer to that poistion marker on map 回答1: Try this, GoogleMap map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); //Pass the latitude and Longitude to method setMap(Dlat, Dlng); private void setMap(double dlat, double dlng) { LatLng location = new LatLng(dlat, dlng); CameraPosition INIT = new CameraPosition.Builder().target

Dynamically increase the size of custom marker in google maps - Android

只愿长相守 提交于 2019-12-12 02:49:21
问题 I use Picasso to retrieve the Bitmap image to use as a marker icon and it apply successfully. But I need to dynamically increase the size of the custom marker for all devices. Because with my code below, it's working fine in some devices but in some others devices, the marker is very big. Here's my code dest = new LatLng(myMarker.getmLatitude(), myMarker.getmLongitude()); markerOption = new MarkerOptions().position(dest); location_marker = mMap.addMarker(markerOption); Target target = new

Check array of locations if user is close and trigger specific event

╄→尐↘猪︶ㄣ 提交于 2019-12-12 02:36:25
问题 I succeeded to determine if the user is within a certain distance of a single marker. What I want to do next is to have the script check, if the user is close to one of multiple locations stored in an array. If yes, I want to have the script trigger the event specific to the respective location. Here is my code: <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=geometry&sensor=true"></script> <script> var map, GeoMarker; function initialize() { var

Toggle inside toggle for Google Maps

久未见 提交于 2019-12-12 02:29:32
问题 I've made a Google Map that show a location at the beginning with 1 marker. From there you have the possibility to switch location. It will then show the new location with 1 marker. Aside from the location switching it's possible to select sub locations for each of the 2 main locations. I thought that making 2 vars ( for each location 1) would be the best thing [example]: var locationsBerlin = [ ['Berlin 1', 52.519433,13.406746, 1], ['Berlin 2', 52.522606,13.40366, 2], ['Berlin 3', 52.52113

How to change the icon of transit stations in google maps?

本秂侑毒 提交于 2019-12-12 02:23:49
问题 I have a google map with custom styling. I would like change the appearance of the rail and bus stations icons to my own png but they do not seem to function like other markers. Is it possible to change them? 回答1: One option would be to hide the transit icons (or just the bus icons), and put markers of your choice in the same locations. You do then need the locations of the stops. proof of concept fiddle var map; function initMap() { map = new google.maps.Map(document.getElementById('map'), {

how to show different markerInfoWindow?

时光总嘲笑我的痴心妄想 提交于 2019-12-12 02:16:50
问题 i'm using GMS for ios. and i'm facing problem that i can't detect which marker did tapped!(Custom markerInfoWindow) you can see my code for custom markerInfoWindow : here i'm creating the markers : -(void)CreateMarks{ for (int l=0 ; l<self.NSMuatableArray.count; l++) { CLLocationCoordinate2D pos = CLLocationCoordinate2DMake([[[self.NSMuatableArray objectAtIndex:l] objectForKey:@"lati"] doubleValue],[[[self.NSMuatableArray objectAtIndex:l] objectForKey:@"longi"] doubleValue]); GMSMarker

create custom marker icons on runtime using android xml

北城以北 提交于 2019-12-12 02:14:56
问题 I am developing an android app in which I need to download an image from its URL, create a bitmap out of it and than display it on map as an icon. so far I have successfully completed to show bitmaps dynamically on map but I need to place my images on some background. something like this shown here How to create a custom-shaped bitmap marker with Android map API v2? any example or suggestion would be helpful. thanks...:) 回答1: I got the answer for my above problem I created a bitmap from view

Adding image to google maps marker for this code

こ雲淡風輕ζ 提交于 2019-12-12 00:50:49
问题 I'm trying to add custom image to marker on this code but I don't know how. I tryed adding new var z and put into image but it's not working. I found more and more codes for similar thing but this looks really easy and I'm quite new in this area do I would like to start with something not that complicated. I found this code here: http://stiern.com/tutorials/adding-custom-google-maps-to-your-website/ function initialize() { var map_options = { center: new google.maps.LatLng(45.813029,15.977895