google-maps-markers

Using Google Places Search Box. How to initiate a search by clicking a button?

浪子不回头ぞ 提交于 2019-12-21 04:03:10
问题 Either I am an idiot or this was an egregious oversight on the part of the Google Maps team. I am attempting to trigger a places search request on a button click event in conjunction with the standard enter keypress event (which is currently working fine). I have combed through the documentation related to the Google Places search box and have found no sutiable solution. Because of confidentiality reasons I am using the example from the demo. function initialize() { var map = new google.maps

Server-side clustering for google maps api v3

做~自己de王妃 提交于 2019-12-20 12:36:34
问题 I am currently developing a kind of google maps overview widget that displays locations as markers on the map. The amount of markers varies from several hundreds up to thousands of markers (10000 up). Right now I am using MarkerClusterer for google maps v3 1.0 and the google maps javascript api v3 (premier) and it works pretty decent for lets say a hundred markers. Due to the fact that the number of markers will increase I need a new way of clustering the markers. From what I read the only

Use an SVG for a marker in Google Maps?

五迷三道 提交于 2019-12-20 12:34:46
问题 i know it's possible to add svg overlays to google maps. i'm wondering if you can use svg files as markers. i tried setting it just like you would a png or jpg file, but nothing shows up. let me know if i should post my code, but i think i am probably approaching it in the wrong way. thanks. 回答1: On Google Maps API v3 it's working just fine for me with this code (which also handles resizing): var marker = new google.maps.Marker({ position: new google.maps.LatLng(lat, lng), icon: new google

markerClusterer on click zoom

半世苍凉 提交于 2019-12-20 11:07:43
问题 I just added a MarkerClusterer to my google map. It works perfectly fine. I am just wondering if there is any way of adjusting the zoom-in behaviour when the cluster is clicked. I would like to change the zoom level if possible. Is there any way of achieving this? Thanks 回答1: There has been an update to the MarkerClusterer source code, allowing much easier access to the click event: google.maps.event.addListener(markerCluster, 'clusterclick', function(cluster) { // your code here }); where

Google Map add marker using place ID

雨燕双飞 提交于 2019-12-20 10:43:35
问题 I am trying to place a marker into Google Maps using its PlaceID. I have the map working and displaying and can also add markers (using Lattitude and Longitude) into it. The code below is what I am using to try and make the marker display using its placeID however it is not displaying. function addPlaces(){ var marker = new google.maps.Marker({ place: new google.maps.Place('ChIJN1t_tDeuEmsRUsoyG83frY4'), map: map }); } This function is called after the map has loaded. google.maps.event

Google Maps API v3 SVG markers disappear

ⅰ亾dé卋堺 提交于 2019-12-20 10:27:08
问题 I am using SVG path notation to create markers along with a polyline using Google Maps API v3. Sometimes, after adding a few markers, they just stop showing from the map. If I pan the map, even just 1px, they show again. SVG markers stop showing after adding a few SVG markers show again after pan This happens in FF, Safari, Chrome and iPhone browsers. Here is my code for the polyline: var lineSymbol = { path: g.SymbolPath.FORWARD_OPEN_ARROW, scale:1.5 }; polyOptions = { strokeColor: '#0026b3'

Getting current location in google map and pass it to a variable in javascript

╄→尐↘猪︶ㄣ 提交于 2019-12-20 07:56:47
问题 I want to display a direction in google map from current location to a known location. my code is shown below: <script> var directionsDisplay; var directionsService = new google.maps.DirectionsService(); var map; function initialize() { directionsDisplay = new google.maps.DirectionsRenderer(); var bne = new google.maps.LatLng(-27.572832, 153.065247); var mapOptions = { zoom:7, center: bne } map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); directionsDisplay.setMap

Google geocode is late (still one step behind)

99封情书 提交于 2019-12-20 07:48:57
问题 I put there my whole code. Trying to determine location address. My script should create still one marker with geocoded address (in console - variable kktina). But, unfortunately, there isn't everything OK. Because by script still resolves previous location (or it takes previous coordinates, dunno). Maybe there is an error in code, but I'm not able to do this anymore.. So asking for help, thank you! <!DOCTYPE html> <html> <head> <title>Google Maps JavaScript API v3 Example: Map Simple</title>

How to Find list of latitude and longitude using pincode as input

给你一囗甜甜゛ 提交于 2019-12-20 07:43:37
问题 is there any way we can we find list of latitude and longitude using zip/pincode? Input: 560103 Output : 12.123456, 72.123456 12.123654, 72.366666 .... .... 12.123456, 72.123456 on google maps, list of lat-long polygon display would be like below map.. Note: Output is just for references, its not correct. 回答1: Checkout Google Api Check this out http://maps.googleapis.com/maps/api/geocode/json?address=110029&sensor=true This will give you the approx location of pincode 110029 All you have to

Google Map API 3 creating different colors for markers from code of API 2

半世苍凉 提交于 2019-12-20 07:26:29
问题 I used this code in API 2 but I can not find equivalent code for API 3. I want to create different colors for markers depending on severity so they are not static values. I have problem how to create GICON, G_DEFAULT_ICON, GSize and addOverlay . If someone tell me how to convert this exact code I will be thankful. I do not want to use micons/color-dot.png because of the specific colors I am using. var severity = parseFloat(markers[i].getAttribute("severity")); var severityIcon = new GIcon(G