angular-google-maps

angular-google-maps run function ONCE after initial map load

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 13:06:55
问题 using angular-google-maps to incorporate a google map into an app I need a command that will run a function ONCE after initial map load is complete - but only on the initial load, not after each map manipulation I can't use idle or tilesloaded since these are fired after every movement... The function I want to run needs to get map bounds to pull data off a server on initial page load - i want this to occur ONCE on initial load, then be a manual function using a refresh map-control - if i use

Google Maps Places Autocomplete - Uncaught TypeError: Cannot read property 'getPlace' of undefined

房东的猫 提交于 2019-12-14 00:35:18
问题 setAutocomplete() { this.originPlaceId = null; this.destinationPlaceId = null; this.travelMode = google.maps.TravelMode.WALKING; this.directionsDisplay.setMap(this.map); this.setMapControls(this.map); this.setupClickListener('changemode-walking', google.maps.TravelMode.WALKING); this.setupClickListener('changemode-transit', google.maps.TravelMode.TRANSIT); this.setupClickListener('changemode-driving', google.maps.TravelMode.DRIVING); console.log(this.originInput); this.originAutocomplete =

How to customize the infoBox(ui-gmap-windows) style for angular google maps?

拥有回忆 提交于 2019-12-13 15:19:59
问题 I'd like to know how to customize the ui-gmap-windows style, default is a blank white square, what about if I wanna a heart with a message inside? I know how to change the content of the ui-gmap-windows but how could I change the style? <ui-gmap-google-map center="map.center" zoom="map.zoom" draggable="true" options="options"> <ui-gmap-markers clusterOptions="clusterOpt" doCluster="true" models="markers" coords="'self'" icon="'icon'" idKey="'idKey'"> <ui-gmap-windows <!--How to change style?

Change angular-google-maps language dynamically

拜拜、爱过 提交于 2019-12-12 09:47:49
问题 Is it possible to change map language dynamically when language is changed ? Or at least have the language map changed the next time I access it (after language is changed). I can set default language on map loading using this code (in mymap.module.ts) : @NgModule({ imports: [ AgmCoreModule.forRoot({ apiKey: 'MY_KEY', language: 'es', }), ] }) And I can get the current language using this.translate.currentLang (in mymap.component.ts). But I don't know how I can combine both. 回答1: In order to

Google Maps drag event doesn't capture center change until dragging ends in Chrome Device Mode

醉酒当歌 提交于 2019-12-12 05:29:27
问题 I'm using Angular Google Maps to include a map in my web app. I am listening to the drag event which fires successfully but the center property of the map doesn't update until the dragging stops. Is this the expected behavior? I couldn't find any docs to confirm. $scope.map = { center: $scope.currentCoords, control: {}, zoom: 15, events: {drag: function(m, e, args){mapDragged(m, e, args)}} }; var mapDragged = function(map, eventName, args){ console.log($scope.map.center); // this value only

angular-google-maps - listen for infowindow domready event

混江龙づ霸主 提交于 2019-12-12 01:25:08
问题 Listening for the domready event in normal js Google maps is relatively easy as outlined here : infoWindow = new google.maps.InfoWindow(); google.maps.event.addListener(infoWindow, 'domready', function() { // whatever you want to do once the DOM is ready }); However it doesn't seem obvious how to do it in angular-google-maps. Is there a solution ? 回答1: The solution when using Angular Google Maps involves using the infowindow control object - see docs. As noted in this issue - where I first

ngfor with agm-circle throws error : Angular2

风格不统一 提交于 2019-12-11 17:33:51
问题 I am using agm ( angular google maps ) and want to draw n number of circles using ngfor but i am getting an error : Can't bind to 'ngFor' since it isn't a known property of 'agm-circle'. this is my html: <agm-circle *ngFor="data in circles" [latitude]="data.lat" [longitude]="data.lng" [circleDraggable]="true" [editable]="true" [fillColor]="'data.color'" [radius]="data.radius" > </agm-circle> this is my ts file having data: lat: number; lng: number; circle: any; @ViewChild(AgmPolygon) polygon:

Cannot pass dynamically map style in angular-google-maps

[亡魂溺海] 提交于 2019-12-11 13:05:16
问题 i have an issue. I'm getting styles dynamically from a services. Styles are arrays and check that all worked ok when added inline but when i'm getting the data dynamically the map renders the default styling. For example here's my code: var styleArray = data.settings.Theme.mapSelected; if(data.settings.Theme.mapSelected != undefined) { $scope.mapOptions = { mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false, styles: styleArray }; } else { $scope.mapOptions = { mapTypeId: google

TypeError: _.includes is not a function, Angular Google Maps

梦想的初衷 提交于 2019-12-11 11:10:01
问题 While integrating google maps using angular-google-maps 2.3.1 with lodash 4.3.0 (Custom Build) , I am getting this error. From some links I got to know they have some issues in latest version but I am not able to find the exact reason behind this issue. 回答1: As I post in a comment, I had the same problem and I solved it downgrading lodash until version 3.8.0 . Not sure why version 4.x doesn't work properly at the moment. 来源: https://stackoverflow.com/questions/35298931/typeerror-includes-is