google-maps-markers

How do add anchor in the image dynamically

别来无恙 提交于 2019-12-24 02:10:03
问题 When we use Google Maps, after we search something, Google will add a marker in the map. When we click on this marker, a detailed information window will show, just like this : I search the "white house",then it create a marker "A". This is not difficult. However I found something more interesting: In the map view, even we do not search anything, when the map zoom to some specified level, there will be some anchors generated. If the mouse over it or click it, it will show something

How to use OnMarkerClickListener

北战南征 提交于 2019-12-24 00:59:05
问题 I'm trying to make an application that allows to open new activity from a marker on the map with the method GoogleMap.OnMarkerClickListener but do not know how to use it. Does anyone help me? 回答1: Just use this: getMap().setOnInfoWindowClickListener(new OnInfoWindowClickListener() { public void onInfoWindowClick(Marker marker) { Intent i = new Intent(getActivity(), NewActivity.class); startActivity(i); } }); I used this code in my custom class that extends MapFragment I've placed it in this

Flutter - google map, does not show my location

时间秒杀一切 提交于 2019-12-24 00:21:58
问题 It seems to have written everything correctly but I can not understand why it does not show my location on the map. Why is it not showing my location? import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; class MyMap extends StatefulWidget { @override MyMapState createState() => MyMapState(); } class MyMapState extends State<MyMap> { GoogleMapController mapController; final LatLng _center = const LatLng(50.006406, 36.236484); void _onMapCreated

Display Custom Marker in Google Maps Using Relative File Path [duplicate]

夙愿已清 提交于 2019-12-23 22:17:06
问题 This question already has an answer here : Using a Relative Path in Javascript to Set Google Map Icon (1 answer) Closed 3 years ago . I am using Google's Javascript APi v.3.0 to develop a web app. I want to be able to display custom markers, but they don't show up when I try to add them. I've written a helper function in Javascript to display a custom marker: function addCustomMarker(iconFile,iconTitle,lat,lng){ var loc = new google.maps.LatLng(lat,lng); var marker = new google.maps.Marker({

Add marker in google maps with Flutter

倖福魔咒の 提交于 2019-12-23 21:50:06
问题 I have managed to create a google map in my flutter app and I am able to show my location and also markers using latitude and longitude. Does anyone know how to create a marker for a business which already exist in google map? What should I pass to the marker to identify a business which is already in google map??? Thanks 回答1: You can use a Place Search or Autocomplete service to find an existing business, and then pass the lat/lng coordinates you get from the results, in geometry.location ,

Google Maps API v3 Hiding and showing a circle bound to a marker

一世执手 提交于 2019-12-23 21:28:56
问题 I have successfully bound a circle to my marker using google map api v3. I know this because if I make the marker dragable the circle moves as well. How can I refer to the circle if the marker is clicked. I need to show the circle if not visible or vice-versa. Here is the code to create the marker and circle var markerOptions = { title: title, icon: markerImage, shadow: markerShadow, position: latlng, map: map } var marker = new google.maps.Marker(markerOptions); // Add a Circle overlay to

google maps v3 duplicate markers - using an array to manage markers but still get duplicates

时光毁灭记忆、已成空白 提交于 2019-12-23 18:18:42
问题 I'm not getting it: I have an array to manage my markers I add to a map. When I update the collection, the markers duplicate even though my markers array still only has the correct number of them in it. I'm sure this is a really simple and stupid mistake on my part - but I'm not seeing it. m.viewMarkers = function(data){ //ajax call to get latLng, returns an object with 4 markers showMarkers(); } function showMarkers(){ g.currentMarkers = []; // setting up my marker array $.each(g

UI Hang while replacing fragment from setOnInfoWindowClickListener interface method of Google Map

左心房为你撑大大i 提交于 2019-12-23 17:49:12
问题 I am using google map in my application and display markers. Now on click of marker window I want to replace the current fragment with other fragment. for (StoreData store : comp.getArrStoreList()) { LatLng l = new LatLng(Double.parseDouble(store.getLat()), Double.parseDouble(store.getLng())); MarkerOptions marker = new MarkerOptions() .position(l) .title(store.getName()) .snippet(store.getCity()) .icon(BitmapDescriptorFactory .defaultMarker(BitmapDescriptorFactory.HUE_AZURE)); Marker mrkr =

How to get a callback from google maps in Android application, when navigation is complete

荒凉一梦 提交于 2019-12-23 16:16:07
问题 I am building an android application, that will show certain points on google maps, for which I have (lat,lang) for all the points shown, with me. Whenever, a user clicks on one of these locations on google maps, I am starting a new Google Maps intent which shows navigation to the user and is supposed to take the user to that (lat, lang). //suppose this function is called on onclick of google maps event function onclick(){ Uri gmmIntentUri = Uri.parse("google.navigation:q=32.885240,-96.763475

Animation between 2 points on Google maps

ぐ巨炮叔叔 提交于 2019-12-23 15:17:12
问题 I need to have a map with a list of markers on it. It needs to transition between these smoothly. I have the following code which currently loops around the markers. var x = 0; function pan_to() { if(x >= addresses.length){ x=0; } $.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address='+addresses[x]+'&sensor=false', null, function (data) { var p = data.results[0].geometry.location var latlng = new google.maps.LatLng(p.lat, p.lng); map.panTo(latlng); }); x++; } setInterval(pan_to