google-maps-markers

How to Create InfoWindows for Multiple Markers in a For loop

我是研究僧i 提交于 2019-12-01 06:07:40
I have the following code and it correctly creates all the markers that I am storing but then when I click on any of them only the last InfoWindow is created and it only appears over the last marker no matter which marker I click on. I would imagine this has something to so with the same variable being used in my for loop. {% for record in records %} //need to do the JSON encoding because JavaScript can't have Jinja2 variables //I need the safe here because Jinja2 tries to escape the characters otherwise var GPSlocation = {{record.GPSlocation|json_encode|safe}}; var LatLng = GPSlocation

removing default mouseover tooltip from marker in google-maps

只谈情不闲聊 提交于 2019-12-01 06:02:11
问题 I have created an application for showing an Information Window popup for markers, The application is working fine and the popup is showing correctly but the only solution is that along with the custom Information Window popup when under mouse-over, default popup with html tag is showing like as shown below. JSFiddle Can anyone please tell me some solution for this My code is as given below var infowindow = new google.maps.InfoWindow(); function point(name, lat, long) { var self = this; self

Android tap on map and get coordinates

醉酒当歌 提交于 2019-12-01 05:54:38
问题 Hi guys I am trying to make an app that once the user taps on a map it gets the coordinates of that specific point. Among others i have also read that: Get coordinates on tapping map in android It seems like the most relevant post but what I want to do is to be able to tap anywhere on the map not on an marker/overlay item. In fact I want to create a marker in that specific point that the user tapped and get the coordinates of it. Is that possible? Thanks Mike 回答1: Yes. In fact, the answer I

Google Maps v3 map.getBounds().containsLatLng is not a function

£可爱£侵袭症+ 提交于 2019-12-01 05:49:05
问题 How do i set the "setMap" function here to port this code to v3? Or port it generally to v3... // map recenter, if element is outside the mapscreen while ((!map.getBounds().containsLatLng(marker.getPosition())) & (showAllCategoryElements == 0)) { var newCenterPointLng = (map.getBounds().getCenter().lng() + marker.getPosition().lng()) / 2; var newCenterPointLat = (map.getBounds().getCenter().lat() + marker.getPosition().lat()) / 2; map.panTo(new google.maps.LatLng(newCenterPointLat,

GoogleMaps MapView crashes onTap in Android?

我是研究僧i 提交于 2019-12-01 05:40:20
I'm currently writing an app displaying a MapView showing a google map. i used the "hello map view" tutorial from http://developer.android.com/resources/tutorials/views/hello-mapview.html and this works so far: the map is displayed, centered and zoomed correctly, even the OverlayItems i added are displayed correctly. But when i click on one of those overlay items i added, the application crashes with a null pointer exception: 07-23 16:24:48.167: ERROR/AndroidRuntime(2530): java.lang.NullPointerException 07-23 16:24:48.167: ERROR/AndroidRuntime(2530): at com.android.internal.app.AlertController

Google maps v3 open infowindow from a link outside of map

荒凉一梦 提交于 2019-12-01 04:12:50
问题 I'm trying to open the info window when a user clicks on a link from outside the map. Not sure what I'm missing here. Basically, I have a list of cities with an id for each (var ids loops over the ids). When the user clicks on that link (on click="myclick('1')" id like the infowindow for that city(1 = london etc) to open up. Any help would be appreciated. var url = "my json link"; var gmarkers = []; function initialize() { var myLatlng = new google.maps.LatLng(0, 0); var myOptions = {

How to Create InfoWindows for Multiple Markers in a For loop

﹥>﹥吖頭↗ 提交于 2019-12-01 03:51:28
问题 I have the following code and it correctly creates all the markers that I am storing but then when I click on any of them only the last InfoWindow is created and it only appears over the last marker no matter which marker I click on. I would imagine this has something to so with the same variable being used in my for loop. {% for record in records %} //need to do the JSON encoding because JavaScript can't have Jinja2 variables //I need the safe here because Jinja2 tries to escape the

Bouncy marker in Google Maps v3

假如想象 提交于 2019-12-01 03:08:10
问题 In Google Maps API v2 we can set to marker an option bouncy:true . It adds to marker eye-candy ability - after dragging this marker, it is bouncing. Is it possible to do in API v3 ? 回答1: I just had a quick look at the API v3 spec for Markers - it doesn't look like the 'bouncy' option is available right now but I wouldn't be surprised to see this get implemented into the v3 API at some point - it's still in Beta and bound to change quite a bit. Here is a link to the API v3 Reference on the

Google Map multiple infowindow does not work

坚强是说给别人听的谎言 提交于 2019-12-01 02:10:20
I tried to add multiple markers and infowindow to a google map using javascript. Below is the code: <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>Google Maps Multiple Markers</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> </head> <body> <div id="map" style="width: 500px; height: 400px;"></div> <script type="text/javascript"> var locations = [ '1961 East Mall Vancouver BC', '2366 Main Mall

Marker changes its position while zoom in or out in google map v2 in android

不问归期 提交于 2019-12-01 00:30:15
I am using Google map V2 to put several markers on map. i am using default marker with different color, my problem is that when i perform zoom in or out operation marker changes its position. I have searched a lot but didn't get any solution. to add marker i am using following code myMap.addMarker(new MarkerOptions().position(new LatLng(serverResponse.get(i).getLat(), serverResponse.get(i).getLon())).title(data).snippet(data2)); You have forgotten to call to the method .anchor(float a, float b) when you are adding your maker. Please try this: myMap.addMarker(new MarkerOptions().position(new