google-maps-markers

Save Map Instance outside of Google Maps

久未见 提交于 2019-12-18 13:48:23
问题 I've made a google maps API (HTML) script that created markers when the user clicks on the map. I've also integrated Google+ login functions so users are unique and have profiles. I now want to make it so users can create their markers on their desired positions and then save the map so they can come back to it later. I however don't want them to use this "https://developers.google.com/maps/documentation/javascript/examples/save-widget" provided function because then the markers are synched

Add numbering label to google map marker

孤人 提交于 2019-12-18 12:44:13
问题 May I know how to add numbering label to google map marker using google map api? Just add label, not trying to change the icon. Thank you. 回答1: If you don't want to use custom icons for each marker then I suggest looking into creating a label class with the OverlayView and then binding the position to the marker. Or you could look at using something like: http://github.com/nmccready/google-maps-utility-library-v3-infobox 回答2: I think a better solution is to use a infoWindow. Something like

How do I track the location of a user throughout the day in Google Maps?

三世轮回 提交于 2019-12-18 12:38:49
问题 How would you track the location of a user for the entire day, like the timeline in Google maps? I have two ideas For example, if I have 200 LatLng values per day, how do I pass all of these LatLng values to Google map as points? I got one google doc reference in that I can track up to 10 locations points only. Is there any Google API to track the user throughout the whole day and make a timeline for it? 回答1: If you have 200 LatLng point you always can just draw them as polyline: ... final

Adding click event to KMLLayer Placemarks and Markers

耗尽温柔 提交于 2019-12-18 12:29:44
问题 How do i attach an onclick event to Placemarks specified in the KML file. Can event listeners be added to both google maps and google earth plugin? How would I go about this? 回答1: In the Google Earth plugin... google.earth.fetchKml(ge, href, function(kmlObject) {}); google.earth.addEventListener(kmlObject, 'click', function(event) { event.preventDefault(); var kmlPlacemark = event.getTarget(); alert(kmlPlacemark.getName()); }); In Google Maps API var ctaLayer = new google.maps.KmlLayer('http:

Adding click event to KMLLayer Placemarks and Markers

跟風遠走 提交于 2019-12-18 12:29:22
问题 How do i attach an onclick event to Placemarks specified in the KML file. Can event listeners be added to both google maps and google earth plugin? How would I go about this? 回答1: In the Google Earth plugin... google.earth.fetchKml(ge, href, function(kmlObject) {}); google.earth.addEventListener(kmlObject, 'click', function(event) { event.preventDefault(); var kmlPlacemark = event.getTarget(); alert(kmlPlacemark.getName()); }); In Google Maps API var ctaLayer = new google.maps.KmlLayer('http:

google maps v3 marker mouseover tooltip

我怕爱的太早我们不能终老 提交于 2019-12-18 12:14:39
问题 I want to put a tooltip made myself with divs when the mouse is over a marker, but I don't know how to get the screen position to put the div on the correct position, here is my code: google.maps.event.addListener(marker, "mouseover", function() { divover.css("left", marker.get("left")); divover.css("top", marker.get("top")); divover.css("display", "block"); }); google.maps.event.addListener(marker, "mouseout", function() { divover.css("display", "none"); }); Obviously the get method fails.

Google maps infowindow showing on wrong marker

风流意气都作罢 提交于 2019-12-18 12:14:35
问题 I have a piece of javascript code where I create markers and attach InfoWindows to them, like this: for (var i = 0; i < 8; i++) { var marker = new google.maps.Marker({ map: map, position: new google.maps.LatLng(lat[i], lng[i]), icon: '/static/images/iconsets/gmap/iconb' + (i+1) + '.png', }); var infowindow = new google.maps.InfoWindow({ content: 'test string' }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); } But when I click one of the markers,

Starting Google Maps App with provided location and marker

喜欢而已 提交于 2019-12-18 12:14:14
问题 From my app I would like to start the Google Maps App with a provided location and a marker. The marker should indicate, that there is something on that given location. For now, I have the following code, which starts with an Intent the Google Maps App with the provided location (51.49234, 7.43045). startActivity( new Intent( android.content.Intent.ACTION_VIEW, Uri.parse("geo:51.49234,7.43045"))); When the Google Maps App starts, it looks like the following: No marker is shown. I would like,

Removing a Marker in Google Maps API v3

天大地大妈咪最大 提交于 2019-12-18 12:10:08
问题 I'm trying to remove a marker that was initialized like this: marker = new google.maps.Marker({ position: latLng, map: map, draggable: true, animation: google.maps.Animation.DROP, title: 'Marker 1', icon: redPin }); google.maps.event.addListener(marker, "click", function() { showMarkerDialog(marker.position, "marker"); }); google.maps.event.addListener(marker, "dblclick", function() { // Add a alert: Are you sure you want to remove this marker? map.removeOverlay(marker); }); Everything works

Removing a Marker in Google Maps API v3

爱⌒轻易说出口 提交于 2019-12-18 12:08:59
问题 I'm trying to remove a marker that was initialized like this: marker = new google.maps.Marker({ position: latLng, map: map, draggable: true, animation: google.maps.Animation.DROP, title: 'Marker 1', icon: redPin }); google.maps.event.addListener(marker, "click", function() { showMarkerDialog(marker.position, "marker"); }); google.maps.event.addListener(marker, "dblclick", function() { // Add a alert: Are you sure you want to remove this marker? map.removeOverlay(marker); }); Everything works