google-maps-markers

Every infowindow is displaying the same data maps api v3

泪湿孤枕 提交于 2019-12-25 19:41:13
问题 I am really stuck on something. Every map marker's infowindow is displaying the same info. It seems to be the content at the end of an array that i use to store content nodes every time. I am pretty sure it is because the infowindow is not being attached to the proper marker var markers = []; var contentArray = []; var titleArray = []; var latlngArray = []; var map; //var infowindow; var concert; function defaultMap() { //Latitude: 38 //Longitude: -97 //window.alert("inside function"); var

How do I make this script fire when I click a Fusion Tables layer?

六月ゝ 毕业季﹏ 提交于 2019-12-25 18:23:56
问题 I have a Fusion Table layer on my map. I want to make it so that when I click on the Fusion Table layer, this script fires. My code so far: gmap = new google.maps.Map(document.getElementById("map-canvas")); google.maps.event.addListener(gmap,'click',function(e){ console.log(e); }); // DONE: google.maps.event.addListener When I click a part of the map that has no Fusion Table layer on it, the script fires. But if I click a part of the Fusion Table layer, it doesn't. What do I do? 回答1: You must

Cluster Markers with Google Maps API, locations from database

和自甴很熟 提交于 2019-12-25 18:20:13
问题 I am creating a google map that is populated with markers based upon information from my database. I have followed the tutorial provided from Google in this first step. The map works fine, however since some of my markers are close together, I would like to take advantage of marker clustering. I’ve followed what I can from Google's tutorial on marker clustering. However, I cannot find a way to get it to work. My markers just show up the way they are, without any clustering. I think I have

agm-marker iconUrl change on click of marker

吃可爱长大的小学妹 提交于 2019-12-25 17:48:22
问题 I am trying to change the iconUrl of marker when it is clicked . I am using angular google maps. iconUrl I am setting using my local assets folder and not from service API. <agm-marker *ngFor="let m of mapArrayList; let i = index" (markerClick)="clickedMarker(infowindow)" [latitude]="m.geometry.location.lat()" [longitude]="m.geometry.location.lng()" [iconUrl] =" { url: './assets/images/car.svg', scaledSize: { width: 40, height: 60 } }"> How can I change the above iconUrl when a marker is

How to give static message in google map API

孤人 提交于 2019-12-25 17:37:42
问题 I am using google map API, it is working fine, like in this map if I click a marker, one dialogue box opens displaying the location address; instead of this I want to display a static value. How can I change my code to do this? function initMap() { var directionsDisplay = new google.maps.DirectionsRenderer; var directionsService = new google.maps.DirectionsService; var map = new google.maps.Map(document.getElementById('map'), { zoom: 14, center: {lat: 12.9577129, lng: 77.6764937} // Starting

Google Maps API V3 : event listener on a class

别说谁变了你拦得住时间么 提交于 2019-12-25 13:09:27
问题 It is possible to detect an event with Google Maps V3 API, for instance (ex 1) : google.maps.event.addListener('drag', function(event) { $("#latD").val(event.latLng.lat()); $("#longD").val(event.latLng.lng()); }); or (ex 2) google.maps.event.addListener(markerDep, 'drag', function(event) { $("#latD").val(event.latLng.lat()); $("#longD").val(event.latLng.lng()); }); here, I specified an instance of a Marker. According to Google Maps API Specification, one can create a listener on a particular

geocode does not determine point location exactly on google map

∥☆過路亽.° 提交于 2019-12-25 10:55:49
问题 In google map when I drag a marker lat() and lng() values shown in textboxes. I want do to like here: Coordinates change for every movement My following code parts work for me. But, when I drag a marker to far, it works, but in little distances lat() and lng() don't change? How can I solve this issue? main js codes are: // fill in the UI elements with new position data function update_ui(address, lat, lng) { $('#lat').val(lat); $('#lng').val(lng); } // move the marker to a new position, and

show marker of current position in google maps

你。 提交于 2019-12-25 08:16:05
问题 I want to show the current position in google maps with a marker inside a Fragment class. The map is already shown, but I get a NullpointerException , when I initialize the MapFragment . I tried it with this initialization: MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map); mapFragment.getMapAsync(this); This is the onMapReady() function: @Override public void onMapReady(GoogleMap googleMap) { this.googlemap_global = googleMap; googlemap_global

Change icon on Google maps

谁说胖子不能爱 提交于 2019-12-25 07:33:23
问题 I have been trying several options but unfortunately I'm unable to have different icons for different locations. I also tried to find out why the weather layer optional field is blank as in other applications but it did work. I would appreciate any help. <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&language=en&libraries=weather"></script> <style type="text/css"> #apDiv1 { position: absolute; right: 240px; top: 5px; width: 160px; height: 39px; z-index: 1;

Google Maps: Can't add marker

流过昼夜 提交于 2019-12-25 06:39:05
问题 Can't get a marker added, probably something very simple but I'm new to this. Thanks. <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?&sensor=true"></script> <script type="text/javascript"> function addMarker() { var marker = new google.maps.Marker({ position: new google.maps.LatLng(-34.397, 150.644), title:"Hello World!" }); } function initialize() { var mapOptions = { center: new google.maps.LatLng(-34.397, 150.644), zoom: 8, mapTypeId: google.maps.MapTypeId