google-maps-api-3

Is there a way to restrict the Google Places Autocomplete to search a city's streets?

允我心安 提交于 2019-12-20 12:26:49
问题 Can I restrict the search to a city's streets when using the Google Places Autocomplete ? 回答1: You can set the Autocomplete options to use geocode as the type, which will restrict the results that are returned to addresses: var input = document.getElementById( 'searchTextField' ); var options = { bounds: yourBounds, types: ['geocode'] }; autocomplete = new google.maps.places.Autocomplete( input, options ); There is no way to restrict the results to just streets, but this will largely achieve

how to display location message in chat window same like whatsapp in android programmatically?

北城余情 提交于 2019-12-20 10:53:13
问题 I am developing a chat application. Where user can send location same like whatsapp . (I am not talking about share live location functionality). For this requirement i have use google place picker api. Here I am attaching a code of that. build.gradle implementation 'com.google.android.gms:play-services-maps:10.2.0' implementation 'com.google.android.gms:play-services:10.2.0' AndroidManifest.xml <meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR_API_KEY" /> <meta

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

Using KMZ Files in Google Maps

余生颓废 提交于 2019-12-20 10:39:17
问题 Is there any way I can use a KMZ file in Google Maps? My KML file is around 10.7MB so it doesn't load on Google Maps. KMZ file is around 2MB. The only way I see it is to have multiple KML but it's too much work. I might end up doing that, but was just wondering if KMZ can be used? Thanks. 回答1: Yes, you can specify a KMZ file using the Maps API: var kmzLayer = new google.maps.KmlLayer('http://www.kmzlinks.com/redirect.asp?id=110&file=PalmIsland%2Ekmz'); kmzLayer.setMap(map); In your specific

Showing map copyright in GMaps API V3

强颜欢笑 提交于 2019-12-20 10:37:37
问题 I'm currently migrating an application from GMaps V2 to V3. As I use OSM and other non-Google map layers, I want to keep the copyright notice at the bottom right. But the reference documentation doesn't give any hints on this. In V2, the copyright even had its own class GCopyrightCollection , and was passed to GTileLayer . Google Code playground also doesn't provide an example for V3. Does anyone know how to do this in the new API? 回答1: The mailing list helped me on this issue (see thread).

With Google Maps API V3, determine if a marker is inside a KML Layer boundary

孤街浪徒 提交于 2019-12-20 10:31:37
问题 Is there a way to determine if a marker has entered an area covered by a KmlLayer? My .kml is mostly made up of a <Polygon> with a bunch of coordinates that define the boundary. There is an article I found that describes some similar to what I'm looking for, created using an overlay: http://www.paulmcilwaine.com/api/google-maps-detecting-markers-in-a-particular-boundary That method has the advantage of using getBounds(), but I am looking for a way to do this with a KmlLayer boundary. KmlLayer

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'

Can you load Google Maps API v3 via Google AJAX API loader

烈酒焚心 提交于 2019-12-20 10:11:17
问题 Some time ago I used the regular method of loading Google Maps API like this: <script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=abcdefg&sensor=true"> Later I switched to Google AJAX APIs to load Google Maps API. This was because a couple of "widgets" on my website needed the Google Ajax API loader so I chose to be consistent and used the AJAX APIs to load Google Maps as well: <script type="text/javascript" src="http://www.google.com/jsapi?key=abcdef"></script>

Google maps API - add marker by address javascript

爱⌒轻易说出口 提交于 2019-12-20 10:01:27
问题 I have database of places with addresses and I want to add markers on google maps. It shows only the default marker, seems like the geocoder.geocode() does nothing. For an example I'm trying to add a marker on " New York City", with no success. <script> var geocoder; var map; var address = "new york city"; geocoder = new google.maps.Geocoder(); function initMap() { var uluru = { lat: -25.363, lng: 131.044 }; var map = new google.maps.Map(document.getElementById('map'), { zoom: 4, center:

Google Maps API, is it possible to highlight specific streets?

狂风中的少年 提交于 2019-12-20 09:59:50
问题 Is it possible with Google Maps API to highlight streets? The only thing i could find that was close to this effect was drawing lines over them. But this is a lot of work and more inaccurate. The lines will also go over place names. What i want is to highlight certain streetnames as if you were navigating from point a to b. So for example if 10 streets are closed by streetworkers i can highlight those streets. 回答1: This can actually be done quite easily by using the Maps API directions