μλ νμΈμ, https://github.com/googlemaps/js-marker-clusterer λλ λ€λ₯Έ λ§μ»€ ν΄λ¬μ€ν° λ¬λ₯Ό μ¬μ©νλ κ²μ λν ν¬μΈν°κ° μμ΅λκΉ? κ°μ¬!
μ£μ‘ν©λλ€, μ§κΈ λΉμ₯ λ릴 μμλ μ‘°μΈμ΄ μμ΅λλ€
@SebastianM μ§λ κ°μ²΄μ λν μ‘μΈμ€λ‘ μν ν μ μλ€κ³ μκ°ν©λλ€. μ¬κΈ°λ₯Ό μ°Έμ‘°νμμμ€ : https://github.com/SebastianM/angular2-google-maps/pull/311
μ무λ μ€μ λ‘ μ΄κ²μ νμ΅λκΉ? markerclusterer js νμΌμ΄ .getMap ()μμ μ λ¬νμ§λ κ°μ²΄λ₯Ό μ’μνμ§ μλ κ² κ°μ΅λλ€.
@AbdulTheProgrammer λ΄κ° μμλλ° , λ΄ κ°μ₯ ν° ν¬λ§μ κ·Έκ²μ΄ μλνλ€λ κ²μ λκΉ? μ§λ μ§μλ¬Έμμ μ¬μ©νλ κ²κ³Ό λμΌν GoggleMapsAPIWrapper μλΉμ€ μΈμ€ν΄μ€μμ getMap ()μ νΈμΆ ν κ²μ΄ νμ€ν©λλ€. μ΄κ²μ΄ νμ¬ κ°μ₯ ν° λ¬Έμ μ λλ€ ....
μ¬μ©μ μ§μ κ΅¬μ± μμλ₯Ό μ¬μ©νμ¬μ΄λ₯Ό sebm-google-map μμ ν¬ν¨ μμΌ°μ΅λλ€. GoogleMapsAPIWrapper λ° nativeMapμ μ¬μ©ν©λλ€.
Googleμ§λ μλ° μ€ν¬λ¦½νΈ API (window.google.maps)λ₯Ό μ¬μ©νμ¬ λ§μ»€λ₯Ό μλμΌλ‘ μΆκ° ν λ€μ MarkerClustererλ₯Ό λ§λλλ€.
λμμ΄λκΈ°λ₯Ό λ°λλλ€.
@ricardojbertolin μΈλ°μ€μ°¬μ΄ μ¬κΈ° # 311μμ μ§μ ν κ²μ²λΌ λμμ΄λ©λλ€.μ§λ λ΄λΆμ μ¬μ©μ μ§μ κ΅¬μ± μμλ μ νν λ€μ΄ν°λΈμ§λ κ°μ²΄μ μ‘μΈμ€νλ λ°©λ²μ λλ€. λ¬Όλ‘ κ΄λ¦¬μ μλΉμ€λ₯Ό μ¬μ©νμ¬ λ§μ»€λ₯Ό μΆκ°νλ λ μ’μ λ°©λ²μ΄ μμ΄μΌν©λλ€. js APIλ₯Ό ν΅ν΄ μλμΌλ‘ μννλ κ²κ³Ό λ°λ ...
λν js-marker-clustererκ° μλνλλ‘ κ³ κ΅°λΆν¬νκ³ μμ΅λλ€. κΈ°λ³Έμ§λ μΈμ€ν΄μ€μ λν μ°Έμ‘°λ₯Ό μ»μ§ λ§ κΈ°λ³Έμ§λ λ§μ»€μ λν μ°Έμ‘°λ νμν©λλ€. λꡬλ λ΄ <sebm-google-map-marker>
λν κΈ°λ³Έμ§λ λ§μ»€λ₯Ό μ»μ μμλ λ°©λ²μ λν μμ΄λμ΄κ° μμ΅λκΉ?
νν
λ§μΆ€ κ΅¬μ± μμ λ° GoogleMapsApiWrapperμ λν μκ° μμ΅λκΉ?
"μ»΄ν¬λνΈ λ΄λΆμ μ¬μ©μ μ»΄ν¬λνΈλ₯Ό λ°°μΉνλ κ²"μ΄ ββμλ―Ένλ λ°λ₯Ό μ΄ν΄νμ§ λͺ»νλ κ² κ°μ΅λλ€.
@ siegerx3 μλ¦¬κ° λ κ°λ¨ν©λλ€. λ¨Όμ μ¬μ©μ μ μ κ΅¬μ± μμ λλ μ§μλ¬Έμ λ§λλλ€.
import { Directive } from '@angular/core';
import { GoogleMapsAPIWrapper } from 'angular2-google-maps/core';
@Directive({
selector: 'custom-directive'
})
export class CustomMapDirective {
constructor (private gmapsApi: GoogleMapsAPIWrapper) {
this.gmapsApi.getNativeMap().then(map => {
// map is the native google map object and the wrapper is the same instance as the one on the map
});
}
}
ν νλ¦Ώμ΄ νμνμ§ μμκΈ° λλ¬Έμ μ§μλ¬Έμ μ¬μ©νμ΅λλ€. μνλ κ²½μ° κ΅¬μ± μμλ₯Ό μ¬μ©νκ³ μ§μ ν μ μμ΅λλ€.
μ¬μ©μ μ μ κ΅¬μ± μμ / μ§μλ¬Έμ μ¬μ©μ€μΈ κ΅¬μ± μμμ directives
μΉμ
μ μ§μ ν΄μΌνλ κ²μ λΉμ°ν©λλ€. μ΄μ κ΅¬μ± μμλ₯Ό 맡 μμ λμΌμμμ€.
<sebm-google-map>
<!-- markers, info windows, etc -->
<custom-directive></custom-directive>
</sebm-google-map>
Angular2 DIκ° μλνλ λ°©μμΌλ‘ μΈν΄ GoogleMapsAPIWrapper μλΉμ€μ λν 곡κΈμλ₯Ό μ§μ νμ§ μμκΈ° λλ¬Έμ 곡κΈμλ₯Ό μ°Ύμ λκΉμ§ κ΅¬μ± μμ νΈλ¦¬λ‘ μ΄λν©λλ€. μ΄ κ²½μ° ν λ¨κ³ λ μ¬λΌ κ°μΌλ©° sebm-google-map
κ΅¬μ± μμμ μ 곡λ GoogleMapsAPIWrapperλ₯Ό μ¬μ©ν©λλ€.
@jfmaeck MarkerManager
μλΉμ€μ μ¬μ©ν μμλ getNativeMarker()
λ©μλκ° μμΌλ©° λνΌμ λν΄ μμμ μ€λͺ
ν λ©μλλ₯Ό μ¬μ©νμ¬ λμΌν λ§μ»€ κ΄λ¦¬μ μλΉμ€ μΈμ€ν΄μ€λ₯Ό μ»μ μ μμ΅λλ€.
νν
μ½λλ₯Ό 보면 μ΄μ μ€λͺ
μ΄ μλ―Έκ° μμ΅λλ€! κ°μ¬ :)
@alexweber λ€μ΄ν°λΈ λ§μ»€ μΈμ€ν΄μ€λ₯Ό μ»λ λ°©λ²μ λν ννΈλ₯Ό μ£Όμ
μ λλ¨ν κ°μ¬ν©λλ€. κ·Έλλ ν κ°μ§ μ§λ¬Έμ΄ μμ΅λλ€. MarkerManager
μ getNativeMarker()
λ©μλλ SebmGoogleMapMarker
μΈμ€ν΄μ€ (λ§μ»€ κ΅¬μ± μμ)λ₯Ό λ§€κ° λ³μλ‘ μμν©λλ€. μ΄ κ΅¬μ± μμλ₯Ό λ³μμμ κ°μ Έ μμ getNativeMarker ν¨μμ μ λ¬νλ λ°©λ²μ μκ³ μμ΅λκΉ?
@jfmaeck λ¬Έμ μμ΄μ! νμ¬ 100 % νμ ν μλ μμ§λ§ κ΅¬μ± μμμμ @ViewChild('myMarker'): SebmGoogleMapMarker
#
λ₯Ό μ¬μ©νκ³ λ§ν¬ μ
μμ <sebm-google-map-marker #myMarker>
just ViewChildλ ngAfterViewInit
μμλ§ μ¬λ°λ₯΄κ² ν΄κ²°λ©λλ€.
@alexweber λμ μ£Όμ μ λ€μ νλ² κ°μ¬λ립λλ€. λΆννλ @ViewChildrenμ μ¬μ©νμ¬ λ§μ»€μ μ‘μΈμ€ ν μ μμ΅λλ€. Plunkrμμ λ°λͺ¨λ₯Ό ν¬ν¬νκ³ ViewChildren κ²°κ³Όκ° μ½μμ κΈ°λ‘λλλ‘ λͺ κ°μ§ λ³κ²½νμ΅λλ€ (νμ¬ λΉ λ°°μ΄).
markers after view init []
http://plnkr.co/edit/7rdOz3QswDL0pik7SmAS?p=preview
κ½€ λ°μμ κ² κ°μ§λ§ λ³Ό κΈ°νκ° μλ€λ©΄ μ λ§ κ°μ¬νκ² μ΅λλ€.
@ContentChildren μ μ¬μ©ν λ @jfmaeck (κ΅¬μ± μμ μμ λ΄λΆμμλ μΈμ€ν΄μ€λ₯Ό κ°μ Έ http://plnkr.co/edit/mukdlZ7K7CIFm6aTdDTp?p=preview
@jfmaeck λΉμ μ κ°κΉμ μ΅λλ€. @ViewChildren
νλ νλ ν¬ μ μμ
ν¬ν¬κ° μμ΅λλ€ : http://plnkr.co/edit/rJMCFoX9GokturcJljLh?p=preview
μ¬μ©μ μ μ 맡 κ΅¬μ± μμ @ContentChildren
( @ SebastianMμ΄ μ§μ ν κ²κ³Ό κ°μ)λ₯Ό μ¬μ©νμ¬ μλνλλ‘νλ €λ©΄ μλνμ§λ§ λ§μ»€μ μ‘μΈμ€νκΈ° μν΄ μμ± ν κ²μΌλ‘ κ°μ νκ³ μ€μ λ‘ μΆκ° κ΅¬μ± μμλ₯Ό μ²μ.
@SebastianM λ° @alexweber λλ¨ν κ°μ¬ν©λλ€!
@alexweber @SebastianM μ°μ , js-marker-clustererλ₯Ό μ¬μ©νλμ΄ λΌμ΄λΈλ¬λ¦¬λ₯Ό μ΄λ»κ² ν¬ν¨ν©λκΉ? νΉμ νλ / μΆμ μμ€μμ ν΄λ¬μ€ν°λ₯Ό μ¬μ©νλ λ°©λ²μ΄ μμ΅λκΉ? λ€μκ³Ό κ°μ΄ ν΄λ¬μ€ν°μ λν μ΄λ―Έμ§λ₯Ό μ΄λ»κ² ν¬ν¨ν©λκΉ? http://i65.tinypic.com/10gxkcw.png
@ricardojbertolin μ½λλ₯Ό 곡μ ν μ μμ΅λκΉ? μ λ angular2λ₯Ό μ²μ μ νκ³ (angularjsμ 1 λ μ΄μ μμ ν΄ μμ΅λλ€) μ‘°κΈ κΈΈμ μμμ΅λλ€.
@alexweber ,
@jpcode μ£μ‘ν©λλ€, νλμμ΄ μμ μνμ§ μμμ΅λλ€ ...
λ΄ νλ‘μ νΈ μ€ νλμ μμ
μ루μ
μ΄ μμ΅λλ€.
νμν κ²½μ° ν λ°μ»€λ₯Ό μμ μ ν¨κ» μ¬μ©ν μ μμ΅λκΉ?
@jpcode
νν
@ siegerx3 μ’μ, λ§μ λμμ΄ λ κ²μ
λλ€.
λλ google maps api + markerclusterer.jsλ₯Ό μ¬μ©νμ¬ λμμΌλ‘ μμ
νκ³ μμ΅λλ€.
@ siegerx3 , μ΄κ²μ Googleμ§λ libλ₯Ό μ¬μ©νλ κΈ°λ³Έ μμ
λλ€.
https://plnkr.co/Tr1Ykkj12HCkF9InQmuW
POC 보λ₯ :
angular2-google-mapsλ₯Ό μ¬μ©νλ λ°©λ²μ "google"κ³Ό κ°μ μ μ κ°μ²΄μμ μΆ©λμ λ°©μ§νκΈ° μν΄ λ΄λΆμ μΆκ°ν΄μΌνλ€κ³ μκ°ν©λλ€.
ν΄κ²° λ°©λ²μ libμμ Googleλ‘λλ₯Ό λ°©μ§νλ κ²μ
λλ€.
μ 곡 (MapsAPILoader, {useClass : NoOpMapsAPILoader})νκ³ μ§μ λ‘λνκ³ clusterer.jsλ₯Ό μΆκ°ν©λλ€.
κ·Έλ¬λ angular2-google-mapsκ° clustererλ₯Ό μ§μνλ μ§μλ¬Έμ μΆκ°νλ©΄ λ μ’μ΅λλ€. :)
@jpcode
λλ μ±κ³΅νμ§ λͺ»ν μ± ν λ°μ»€μμ μλνλλ‘ λͺ μκ°μ 보λμ΅λλ€.
νμ λ¬Έμ μ κ΄λ ¨μ΄μλ μ€λ₯κ° λ°μνμ΅λλ€.
κ·Έλμ μ¬κΈ°μ μ½λλ₯Ό λ³΄μ¬ λλ¦¬κ² μ΅λλ€.
import { Directive, OnDestroy, OnInit } from '@angular/core';
import { GoogleMapsAPIWrapper } from 'angular2-google-maps/core';
import { GoogleMap, Marker } from 'angular2-google-maps/core/services/google-maps-types';
import { AppService } from '../../../services/index';
import { Observable } from 'rxjs';
declare const google;
declare const MarkerClusterer;
@Directive({
selector: 'custom-map'
})
export class CustomMapDirective implements OnInit, OnDestroy {
private map: GoogleMap;
constructor(private gmapsApi: GoogleMapsAPIWrapper, private appService: AppService) {
}
ngOnInit() {
this.gmapsApi.getNativeMap().then(map => {
this.map = map;
let shopMarker = {
url: "assets/img/marker_shop.svg", // url
scaledSize: new google.maps.Size(50, 50)
}
let loungeMarker = {
url: "assets/img/marker_lounge.svg", // url
scaledSize: new google.maps.Size(50, 50)
}
let markers = [];
let style = {
url: "/assets/img/marker.svg",
height: 50,
width: 50,
anchor: [-14, 0],
textColor: '#bd0b1d',
textSize: 11,
backgroundPosition: "center center"
};
var options = {
imagePath: "/assets/img/marker",
gridSize: 70,
styles: [style, style, style]
};
Observable
.interval(500)
.skipWhile((s) => this.appService.Shops == null || this.appService.Shops.length <= 0)
.take(1)
.subscribe(() => {
for (let shop of this.appService.Shops) {
var marker = new google.maps.Marker({
position: new google.maps.LatLng(shop.Latitude, shop.Longitude),
icon: shop.Lounge ? loungeMarker : shopMarker
});
google.maps.event.addListener(marker, 'click', () => {
this.appService.SelectedShop = shop;
});
markers.push(marker);
}
var markerCluster = new MarkerClusterer(map, markers, options);
}
})
});
}
}
μ΄ μ§μλ¬Έμ angular2-google-maps νκ·Έμ λ£μ΅λλ€.
<sebm-google-map>
<custom-map></custom-map>
</sebm-google-map>
@ siegerx3 , angular2-google-mapsλ₯Ό μ¬μ©νμ¬ POCλ₯Ό λ§λ€μμ΅λλ€.
μ κ·Όνλ€:
angular-2-google-mapsμ λ€λ₯Έ μ§μλ¬Έμ μ¬μ©ν μλ μμ§λ§ ν΄λ¬μ€ν° λ¬λ₯Ό μ§μνκΈ° μν΄ libμ 무μΈκ°λ₯Ό μΆκ°νλ©΄ λ μ’μ΅λλ€.
->
μ΄ libλ₯Ό μ¬μ©νμ¬μ§λλ₯Ό 그리λ κ²μ μλ―Έκ° μκΈ° λλ¬Έμ λ€μμλ Googleμ§λλ₯Ό μ¬μ©νκΈ° λ§νλ©΄λ©λλ€.μ΄ κ²½μ° plunkrκ° λ³΄μ¬μ£ΌκΈ° μ μ google maps libs + clusterer.jsλ₯Ό μ¬μ©νλ κ²μ΄ λ λ«λ€κ³ μκ°ν©λλ€.
import { Directive } from '@angular/core';
import { GoogleMapsAPIWrapper } from 'angular2-google-maps/core';
import { GoogleMap, Marker } from 'angular2-google-maps/core/services/google-maps-types';
// npm install js-marker-clusterer --save
import 'js-marker-clusterer/src/markerclusterer.js';
declare const google;
declare const MarkerClusterer;
@Directive({
selector: 'googlemap-directive'
})
export class GoogleMapDirective {
googleMarkers : any;
_map: any;
zoom: number = 3;
lat: number = 51.673858;
lng: number = 7.815982;
markers: marker[] = [
{
lat: 51.673858,
lng: 7.815982
},
{
lat: 51.373858,
lng: 7.215982
},
{
lat: 51.723858,
lng: 7.895982
}
]
initMarkers(){
let i = 0;
let markers = this.markers;
var result = [];
for ( ; i < markers.length; ++i ){
result.push( new google.maps.Marker({
position : markers[ i ]
})
);
}
return result;
}
constructor (private gmapsApi: GoogleMapsAPIWrapper) {
var me = this;
this.gmapsApi.getNativeMap().then(map => {
// instance of the map.
me._map = map;
me.initializeMap();
});
}
initializeMap(){
var me = this;
me.googleMarkers = me.initMarkers();
var mc = new MarkerClusterer( me._map, me.googleMarkers, { imagePath: 'https://googlemaps.github.io/js-marker-clusterer/images/m' } );
}
}
interface marker {
lat: number;
lng: number;
}
angular2-google-mapsμμ 곡κΈμλ₯Ό μ¬μ©νμ¬ Googleμ§λλ₯Ό λ λ²λ‘λνλ κ²μ λ°©μ§νλ λ°©λ²
κ΅¬μ± μμ μ μμμ 곡κΈμ μΆκ°
import {OnInit, Component } from '@angular/core';
import { SebmGoogleMap, MapsAPILoader, NoOpMapsAPILoader } from 'angular2-google-maps/core';
@Component({
selector: 'site-map',
templateUrl: './site-map.component.html',
styleUrls: ['./site-map.component.css'],
providers: [
{
provide: MapsAPILoader, useClass: NoOpMapsAPILoader
}
],
})
ν νλ¦Ώ μ μμμ μ§μλ¬Έμ μΆκ°ν΄μΌν©λλ€.
<sebm-google-map #sitemap
[disableDefaultUI]="false"
[zoom] = "zoom"
[zoomControl]="true"
[latitude]="lat" [longitude]="lng">
<!--
<sebm-google-map-marker
*ngFor="let m of markers; let i = index"
(markerClick)="openDetail(m)"
[latitude]="m.lat"
[longitude]="m.lng"
[label]="m.label"
[markerDraggable]="m.draggable"
[iconUrl]="'assets/img/marker.png'"
(dragEnd)="markerDragEnd(m, $event)">
<sebm-google-map-info-window [disableAutoPan]="true" (infoWindowClose)="onCloseDetail.emit()">
<h5>{{m.address}}</h5>
<div>{{m.city}}, {{m.state}}, {{m.country}}</div>
</sebm-google-map-info-window>
</sebm-google-map-marker>
-->
<googlemap-directive></googlemap-directive>
</sebm-google-map>
@jpcode
λλ μ΄κ²μ΄ angular2-google-maps λΌμ΄λΈλ¬λ¦¬μ μΆκ°λμ΄μΌνλ€λ λ° λμνμ§λ§ λ΄ μ루μ
μμλ μΈκΈ ν κ²μ²λΌ maps sdkκ° λ λ²λ‘λλμ§ μμ΅λλ€.
λλ λ¨μ§ agm libκ° ν μμλ ν λ§μ΄νκ³ νμν λΆλΆμ μ§μ μννλλ‘ν©λλ€.
λΏ‘ λΉ΅λ¨
zip νμΌλ‘ μμ
μμ λ₯Ό 곡μ ν΄ μ£Όμκ² μ΅λκΉ?
λΏ‘λΏ‘
κ·Έκ² μΆ©λΆνλ€λ©΄ λ΄μΌ λ§λ€ κ²μ :)
angular-cliμ λν΄ μ μκ³ μμ΅λκΉ? κ·Έλ μ§ μμΌλ©΄ κΈ°λ³Έμ μΈ κ²μ ν κ²μ
λλ€.
λΏ‘ λΉ΅λ¨
λ€, μ‘°κΈ ... Googleμ§λ API + λ§μ»€ ν΄λ¬μ€ν° λ¬λ₯Ό μ¬μ©νμ¬ ν΄λ¬μ€ν° νλ₯Ό μ€νν μμμμ΅λλ€. λμ angular2-google-maps ...λ₯Ό μ¬μ©νμ¬ μ루μ
μ μλ²½νκ² νμ
νκ³ μΆμ΅λλ€.
λΉμ μ λμμ λ§μ΄ tnx
λΏ‘λΏ‘
https://drive.google.com/open?id=0B4y4KJY7l3rPNTdqR0hyNTRqVHc
npm install
λ° ng serve
. angular-cliκ° μ€μΉλμ§ μμ κ²½μ° λ¨Όμ npm install angular-cli -g
μ€μΉνμμμ€.
μ΄κ²μ μ΅μ μ μ루μ μ΄ μλλλ€. μμ§ ν΄λ¬μ€ν° μ§μλ¬Έμ΄ μκΈ° λλ¬Έμ λ΄κ° λ§λ ν΄κ²° λ°©λ²μ λλ€.
νΈμ§νλ€:
μν°μ΄ μλνμ§ μμμ ν¬λ§·ν
μ΄ μ΄μ ν μ μμΌλ μ€λλ μλν°λ₯Ό μ¬μ©νκ³ μμμ΄μ ^^
λΏ‘ λΉ΅λ¨
κ°μ¬ν©λλ€. μ΄ μ루μ
μ νμΈνκ² μ΅λλ€ :)
μ΅κ·€λ¬ 2 κ΅¬κΈ λ§΅μ ν¬ν¨ λ μ λ°μ΄νΈκ° μμ΅λκΉ? μμ μ€μΈ νλ‘μ νΈμ μ λ§ μ¬μ©ν΄μΌν©λλ€.
μλ
νμΈμ.
μ λ₯Ό ν¬ν¨ν μ¬λλ€μ΄ μ 곡 ν μμ μ€ νλλ₯Ό κ³μ μ¬μ©ν μ μμ΅λλ€. :)
λΉμ°ν μΆ©λΆνλ€λ©΄
λΏ‘λΏ‘
Btw λͺ¨λ κ²μ΄ μλ νμ΅λκΉ? λμμ΄ λμλμ?
λΏ‘ λΉ΅λ¨
λ€, λ§μ λμμ΄λμμ΅λλ€. Tnx!
νν
λλ λΉμ μ μλ₯Ό μ§μ μ¬μ©νκ³ κ·Έκ²μ΄ νλ₯νκ² μλνμ΅λλ€.
νμ§λ§ μ΄μ λ΄ λ¬Έμ λ λ§μ»€λ₯Ό μ λ°μ΄νΈ ν μ μλ€λ κ²μ λλ€. ngOnChangesλ₯Ό μ¬μ©νμ¬ μ λ°μ΄νΈ λ ν¬μΈνΈ λ°°μ΄μ μ λ¬νλλ° λ°°μ΄μ΄ λ³κ²½λλ κ²μ λ³Ό μ μμ§λ§ λ°°μ΄μ΄ λΉμμ§λ©΄ λ§μ»€κ° μ κ±°λμ§ μμ΅λλ€.
νμ΄ μμ΅λκΉ?
λΏ‘λΏ‘
κ·Έκ²μ΄ λμμ΄λμλ€λ κ²μ΄ μ’μ΅λλ€!
μ€μ λ‘ λ©°μΉ μ μ λμΌν / μ μ¬ν λ¬Έμ κ° λ°μνμ§λ§ μμ§ ν΄κ²°μ± μ μ°Ύμ μκ°μ΄ μμμ΅λλ€.
λ΄κ° λκ°λ₯Ό λ°κ²¬νλ©΄ μ¬κΈ°μ κ²μ ν κ²μ λλ€.
μꡬ ν΄λ¬μ€ν° λ¬Έμ μ λν ν΄κ²°μ± μ μ°Ύμμ΅λλ€.
.interval(100)
.take(1)
.subscribe(() => {
if(this.markerCluster) {
this.markerCluster.clearMarkers();
}
if (this.points.length > 0) {
for (let point of this.points) {
let marker = new google.maps.Marker({
position: new google.maps.LatLng(point.Latitude, point.Longitude),
icon : markerIcon
});
this.markers.push(marker);
}
} else {
this.markers = [];
}
this.markerCluster = new MarkerClusterer(map, this.markers, options);
});
Observable μΈλΆμμ markerClusterλ₯Ό μ μΈ ν λ€μ μμμ μ‘΄μ¬νλ κ²½μ° clearMarkers ()λΌλ ν¨μλ₯Ό μ€ννμ¬μ§λμμ κΈ°μ‘΄ λ§μ»€λ₯Ό μ κ±°νμ§λ§ λ°°μ΄μλ λ¨κ²¨ λ‘λλ€ (λ°λΌμ λ€λ₯Έ λ Όλ¦¬λ λ°°μ΄μ λΉ μλλ€. ).
λ΄ λ¬Έμ λ₯Ό ν΄κ²°νλ κ²μ΄, μ΄μ©λ©΄ siegerx3 @ λΉμ λ λμμ΄λ©λλ€
λΏ‘λΏ‘
κ·Έ λΆλΆμ λ€μ μμ ν λ νμΈνκ² μ΅λλ€. κ°μ¬ν©λλ€. :)
μλ
νμΈμ μ¬λ¬λΆ,μ΄ ννΈμ κ°μ¬λ립λλ€
νμ κ΅¬μ± μμλ₯Ό μ¬μ©νμ¬ getNativeMapμ μ»μμ΅λλ€.
μ§λ 컨ν
μ€νΈ λ©λ΄λ₯Ό ꡬννκ³ μμ΅λλ€.
<sebm-google-map>
<mapmenu-component></mapmenu-component>
μ κ²½μ°μ λ¬Έμ λ νμ κ΅¬μ± μμ ν
νλ¦Ώμ΄ λ³΄μ΄μ§ μλλ€λ κ²μ
λλ€.
κ·Έκ²μ HTMLλ‘ λ λλ§λ©λλ€
<div class="sebm-google-map-content" _ngcontent-rgy-8="">
보μ΄μ§ μλ κ΅¬μ± μμμ
λλ€
μμΉμ μΌλ‘ sebm-google-map μμ htmlμ λ£μ μ μμ΅λκΉ?
OverlayViewλ₯Ό μ¬μ©νμ§ μκ³ HTMLλ‘ κ°κ³ μΆμ΅λλ€.
κΈ°λ₯μ 2 κ°μ κ΅¬μ± μμ (μ§μλ¬Έ + κ΅¬μ± μμ)λ‘ λΆλ¦¬νμ¬ μ²λ¦¬ ν μμμμ΅λλ€.
1.) sebm-google-map λ΄λΆμ μμ΄μΌνλ©° api μ κ·Ό μ μν μνλ κ²
2.) sebm-google-map μΈλΆμ μμ΄μΌνλ κ² (κ·Έλ μ§ μμΌλ©΄ μμ± λ htmlμ΄ νμλμ§ μκΈ° λλ¬Έ)
μλ
νμΈμ ν,
@ siegerx3 https://drive.google.com/open?id=0B4y4KJY7l3rPNTdqR0hyNTRqVHc μ μ½λλ₯Ό μ¬μ©νμ΅λλ€.
μ μλνμ§λ§ ν΅ν© ν μ μμ΅λλ€.
λΏ‘ λΉ΅λ¨
ν΄λ¬μ€ν°κ° μμ§ λͺ¨λμμ ꡬνλμ§ μμκ³ λͺ¨λμ λ§μ»€λ₯Ό μ¬μ©νμ§ μκΈ° λλ¬Έμ ν΄λ¬μ€ν°λ§μ μ¬μ©λλ λμΌν μ¬μ©μ μ μ κ΅¬μ± μμμμ λ€μ΄ν°λΈ 맡 APIλ₯Ό μ¬μ©ν΄μΌνλ€κ³ μκ°ν©λλ€.
λ°λλΌ μλ° ββμ€ν¬λ¦½νΈμμνλ κ²μ²λΌ λΌλ²¨κ³Ό μ 보 μ°½μ μλμΌλ‘ μΆκ°νλ κ²μ
λλ€.
λΏ‘λΏ‘
λλ μ€μ λ‘ μ΄κ²μ λν΄ μ§μ μμ νκ³ μμ΅λλ€. λΌμ΄λΈλ¬λ¦¬ μ© MarkerClustererPlusλ‘ μ νν΄μΌνκ³ λ€μ μ½λλ₯Ό μ¬μ©νμ¬ ν΄λ¬μ€ν° μ체λΏλ§ μλλΌ κ°λ³ λ§μ»€μ λν μ 보 μ°½μ νμ±ννκ³ μμ΅λλ€.
.interval(100)
.take(1)
.subscribe(() => {
if (this.markerCluster) {
this.markerCluster.clearMarkers();
this.markers = [];
}
if (this.points.length > 0) {
for (let point of this.points) {
let marker = new google.maps.Marker({
position: new google.maps.LatLng(point.Latitude, point.Longitude),
icon : markerIcon,
title: 'this is a title'
});
marker.addListener('mouseover', function() {
infowindow.open(map, marker);
});
marker.addListener('mouseout', function() {
infowindow.close(map, marker);
});
this.markers.push(marker);
}
} else {
this.markers = [];
if (this.markerCluster) {
this.markerCluster.clearMarkers();
}
}
this.markerCluster = new MarkerClusterer(map, this.markers, options);
google.maps.event.addListener(this.markerCluster, 'mouseover', function(cluster) {
let content = 'Cluster Window';
let info = new google.maps.MVCObject;
let clusterInfowindow = new google.maps.InfoWindow();
clusterInfowindow.setContent(content);
clusterInfowindow.open(map, info);
clusterInfowindow.setPosition(cluster.getCenter());
google.maps.event.addListener(map, 'zoom_changed', function() { clusterInfowindow.close(); });
});
});
μ μΌν λ¬Έμ λ ν΄λ¬μ€ν° μ°½μ λ«λ λ°©λ²μ μμλ΄λ κ²μ λλ€. ν΄λ¬μ€ν° μ°½μ 맡μ λ λ λ λ«νμ§ λ§ ν΄λ¬μ€ν°λ₯Ό λ λ λλ λ«νμ§ μμ΅λλ€.
λꡬλ μ§ κ°λ 2μμ κ²½μ μ§λ₯Ό μ¬μ©ν μ μμ§λ§ μ¬κΈ° " https://developers.google.com/maps/documentation/javascript/reference#DirectionsWaypoint "μ μΈκΈ λλλ‘ lat λ° lngλ₯Ό μ¬μ©ν μ μλμ§ μκ³ μμ΅λκΉ?
@naranmistry λΉμ μ΄ μνλ κ²μ μ‘°κΈ μ§μ ν μ μμ΅λκΉ?
λΉμ μ κ³νμ΄ μ νν λμ§ λͺ¨λ₯΄κ² μ΄μ. λ€λ₯Έ μ¬λμ΄ μ΄ν΄ν μ μμ΅λκΉ?
κΈ°λ³Έμ μΌλ‘ lng λ° lat κ°μ λ¬Έμμ΄ λμ μ¨μ΄ ν¬μΈνΈμ λ£μ μ μκΈ°λ₯Ό μν©λλ€. angular2-google-mapsλ₯Ό μ¬μ©νμ¬ κ°λ₯ν©λκΉ? κ²½λ λ° lattidute κ°μ μ¬μ©νμ¬ μ¬λ¬ νΉμ κ²½μ μ§κ°μλ κ²½λ‘λ₯Ό νμνκ³ μΆμ΅λλ€.
λ΄κ° μ¬λ°λ₯΄κ² μ΄ν΄νλ©΄μ΄ λͺ¨λμ λν μ°κ²°μ λ³Ό μ μμ§λ§ μΌλ°μ μΌλ‘ λ¬Έμλ₯Ό 보면 location Type: string|LatLng|Place
λ©λλ€. μ, μμ±μμμ μ«μ κ°μ μ¬μ©νλ Googleμ§λ LatLng κ°μ²΄λ₯Ό μ¬μ©ν μ μμ΅λλ€.
κ·Έκ² λΉμ μκ² νμν κ²μ λκΉ?
κΈ°λ³Έμ μΌλ‘ λ¬Έμμ λμμλλλ‘ μ λ¬νλ €κ³ νμ§λ§ κ³μ μ€ν¨νλ λ°©λ²μ μκ³ μΆμ΅λλ€. lat λ° lngλ₯Ό μ¬μ©νλ κ²½μ μ§μ μλ μκ° μμ΅λκΉ?
νΌλμ€λ¬μμ λ―Έμν΄ λ λͺ ν νμ΄μΌ νμ΄
λλ κ·Έλ κ² μκ°νμ§ μλλ€. νμ§λ§ μμ λ‘ μ½λλ₯Ό μ 곡 ν μ μλ€λ©΄? plunkr μμμ²λΌ, λ΄κ° μ°Ύμ μμλ κ²μ λ³Ό μμμμ΅λλ€. :)
μ’μ, νλ λͺ¨μ λ³Όκ²
κ°μ¬
μ£μ‘ν©λλ€. _marker-cluster_ μ§μλ¬Έ λ΄μ _infowindow_μμ _click event_λ₯Ό κ°λ‘ μ±κ±°λ κ° λ§μ»€μ λν΄ _sebm-google-map-info_ κ΅¬μ± μμλ₯Ό λ λλ§ ν μ μλμ?
κ°μ¬ν©λλ€!
@fsciutiμ κ°μ λ¬Έμ κ° μμ΅λλ€.
ν΄κ²°μ±
μ μ°Ύμμ΅λκΉ?
agm-maps
λ μ¬μ ν ν΄λ¬μ€ν°λ₯Ό μ§μνμ§ μκΈ° λλ¬Έμ @ siegerx3 μ μλ₯Ό λ€μ΄ λ§μ»€ λ³κ²½ μ¬νκ³Ό @nanomoffetμ λ§μ»€ μ 보 μ°½ μμ λ₯Ό μ¬μ©νμ΅λλ€. μ νμ΄! κ°μ¬ν©λλ€. κ·νμ μκ° λ§μ λμμ΄λμμ΅λλ€.
무μΈκ°λ₯Ό λλ €μ£ΌκΈ° μν΄ λ€μ λ§ν¬μμ @ siegerx3 μμ μ μ λ°μ΄νΈ λ λ²μ μ μ 곡ν©λλ€.
https://drive.google.com/open?id=0B51AX67ezltoOFdSNTQ1NlQ4SU0
λ€μκ³Ό κ°μ΄ λ³κ²½λμμ΅λλ€.
@agm/core
μ λ§κ² μ’
μμ± μ
λ°μ΄νΈ@agm/core
μ λ§κ² μ½λ μ
λ°μ΄νΈ@andorfermichael κ°μ¬ν©λλ€, λΉμ μ νλ₯ν©λλ€! ν κ°μ§ μ§λ¬Έμ΄ μμ΅λλ€. μ§μλ¬Έ (λ§μ»€μ ν΄λ¬μ€ν° λͺ¨λ)μ μ€νμΌμ ꡬ체ννλ €λ©΄ μ΄λ»κ²ν΄μΌν©λκΉ? λ¨μν κ΅¬μ± μμλ‘ λ§λλ κ²μ λν΄ μκ°νμ§λ§ Observableμ μ΅μ κ³Ό μ€νμΌμ μ¬λ°λ₯΄κ² 곡κΈνλ λ°©λ²μ λͺ¨λ₯΄κ² μ΅λλ€.
@picosam
κ΅¬μ± μμκ° νμνμ§ μκ³ ES6 λͺ¨λ λ§ μ¬μ©νλ©΄λ©λλ€.
μ νμΌμ λ§λ€κ³ ꡬμ±μ λ΄ λ³΄λ λλ€. μ :
_google-maps.config.ts_
export const markerIcon = {
url: '/assets/marker.png', // url
scaledSize: new google.maps.Size(35, 35)
};
const style = {
url: '/assets/cluster.png',
height: 40,
width: 40,
textColor: '#FFF',
textSize: 11,
backgroundPosition: 'center center'
};
export const options = {
imagePath: '/assets/cluster',
gridSize: 70,
styles: [style, style, style]
};
κ·Έλ° λ€μ _marker-cluster.ts_μμ ν΄λΉ λ³μ / λͺ¨λμ κ°μ Έμ΅λλ€.
import { markerIcon, options } from './google-maps.config';
@handorfermichael danke noch mal !!!
λ¬Όλ‘ κ·Έλ° λ€μ 볡μ‘ν μμ΄μ½κ³Ό μ΅μ Google Maps Javascript λͺ¨λ λ²μ μ λ¬Έμν λ λͺ¨λ κ²μ μ¬μ©ν μ μμ΅λλ€. λ§μ΅λκΉ?
@picosam κ·Έλ κ² μκ°νμ§λ§ μμ§ μλνμ§ μμμ΅λλ€
@andorfermichael μ΄κ²μ λλΌμ΄ μ§μ
μ
λλ€ π
κ·Έλ¬λ λλ μ½κ°μ λ¬Έμ μ μ§λ©΄νκ³ μμ΅λλ€
μ 보창μ ν΄λ¦νμ¬ λ€λ₯Έ κ²½λ‘λ‘ λ¦¬λλ μ ν΄μΌνλλ° μ 보창μ ν΄λ¦ μ΄λ²€νΈκ° μμ΅λλ€. κ·Έλμ λμ "closeclick"μ΄λ²€νΈλ₯Ό μ¬μ©νμ΅λλ€. μ¬κΈ°μ μ½λκ° μμ΅λλ€.
infowindow.addListener('closeclick', function () { this.router.navigate(['/blabla', id]); });
λͺ¨λ κ²μ΄ μ μλνμ§λ§ μ 보창 λ«κΈ° λ²νΌμ ν΄λ¦νλ©΄ μ΄λ²€νΈκ° νΈμΆλμ§λ§ μ€λ₯κ° λ°μν©λλ€.
this.router is undefined
_ λ¬Όλ‘ λΌμ°ν° λΌμ΄λΈλ¬λ¦¬λ₯Ό κ°μ Έμ€κ³ λΌμ°ν°λ μμ±μμμ μ μν©λλ€ _
λ€λ₯Έ κΈ°μ μ μλν΄ λ³΄μμ΅λλ€. λΆλͺ¨ κ΅¬μ± μμμ μ§μλ¬Έ μ¬μ΄μ μ΄λ²€νΈ μ΄λ―Έ ν° (μ
λ ₯ / μΆλ ₯ κΈ°μ )λ₯Ό μ¬μ©νμ΅λλ€.
맨 μμ @Output() eventEmitter = new EventEmitter()
λ₯Ό ν΄λμ€ λ³μλ‘ μ μνμ΅λλ€.
κ·Έλ¦¬κ³ κ°μ μ₯μμμ μΌμ΄λ μ¬κ±΄,
infowindow.addListener('closeclick', function () { this.eventEmitter(id); });
λν λͺ¨λ κ²μ΄ μ μλνμ§λ§ μ 보창 λ«κΈ° λ²νΌμ ν΄λ¦νλ©΄ μ΄λ²€νΈκ° νΈμΆλμ§λ§ μ€λ₯κ° λ°μν©λλ€.
this.eventEmitter is undefined
μ΄ λ¬Έμ λ₯Ό ν΄κ²°ν μμλ λ°©λ²μ΄ μμ΅λκΉ?
@ hossam-maurice λλ this
μν΄ μ€λ₯κ° λ°μνλ€κ³ κ°μ ν©λλ€. κ·νμ κ²½μ° this
λ μ΄λ²€νΈλ₯Ό λ°μμν¨ μμ μΈ μ 보창μ
λλ€. μ΄λ¬ν μ΄μ λ‘ ES6 / ECMAScript2015μλ νμ΄ν κΈ°λ₯μ΄ λμ
λμμ΅λλ€. νμ΄ν ν¨μλ₯Ό μ¬μ©νλ κ²½μ° this
λ ν¨μκ° νΈμΆ λ λ°©μμ΄ μλλΌ μ£Όλ³ λ²μμ μμ‘΄ν©λλ€.
λ°λΌμ infowindow.addListener('closeclick', () => { this.eventEmitter(id); });
κ° ν¨κ³Όκ°μμ κ²μ
λλ€.
μμΈν λ΄μ©μ ExploringJS-Arrow Functions λ° MDN-Arrow Functionsλ₯Ό μ°Έμ‘°νμμμ€.
@andorfermichael μ λ§ κ³ λ§μμ, μλνμ΅λλ€ : D π
μλ
νμΈμ, Google λλΌμ΄λΈμ μ¬μ©μ μ§μ λ§μ»€ ν΄λ¬μ€ν°λ₯Ό μ¬μ©νμΌλ©° μ μμ μΌλ‘ μλν©λλ€.
μ΄μ ν κ°μ§ λ¬Έμ κ° μμ΅λλ€. λ§μ»€λ₯Ό ν΄λ¦νκ³ λΆνΈ μ€νΈλ© λͺ¨λ¬μ μ΄μ΄μΌν©λλ€. κ·Έλ¬λ λλ μ΄κ²μ μ΄λ»κ² ν μ μλμ§ μ λ§λ‘ λͺ¨λ₯Έλ€. ν΄λ¦μ μ΄λ²€νΈ 리μ€λλ₯Ό μ¬μ©νκ³ κ²½κ³ λ₯Ό νμνλ €κ³ νμ§λ§ μλνμ§λ§ λΆνΈ μ€νΈλ© λͺ¨λ¬μ ννλ λ°©λ²μ λͺ¨λ₯΄κ² μ΅λλ€. μ΄λ€ μμ΄λμ΄?
κ°μ¬ :)
μλ νμΈμ, μ 보창μ λ²νΌμ μΆκ°νλλ° ν΄λ¦ μ΄λ²€νΈκ° μ‘νμ§ μμ΅λλ€. μ΄λ»κ²νλμ§ μμλμ?
μλ
νμΈμ.
μλ
νμΈμ μ루μ
μ κ°μ¬λ립λλ€. λ΄λΆ λ§μ»€μ λ°λΌ ν΄λ¬μ€ν° μμμ λ³κ²½νλ λ° λμμ μ£Όμκ² μ΅λκΉ? λΉ¨κ°, λ
Έλ λ° νλκ³Ό κ°μ.
μ’
λ₯ μλΆ
@ vugar005 μμμ λ³κ²½νμ¬ μ νν 무μμ μλ―Ένλμ§ μ΄ν΄νμ§ λͺ»ν©λλ€. νμμ λ°λΌ ν΄λ¬μ€ν°μ μ΄λ―Έμ§λ₯Ό κ°λ¨ν λ³κ²½ν μ μμ΅λλ€. λ΄κ° μλ ν Googleμ λ§μ»€ ν΄λ¬μ€ν° λΌμ΄λΈλ¬λ¦¬λ ν΄λ¬μ€ν° λΉ λ§μ»€ μκ° μ¦κ°ν¨μ λ°λΌ μ¬μ©λλ m1 ~ m5 (m = κΈ°λ³Έκ°)λΌλ 5 κ°μ μλ‘ λ€λ₯Έ μ΄λ―Έμ§λ₯Ό μ 곡ν©λλ€. μ νν μκ³ κ°μ λͺ¨λ₯΄κ² μ΅λλ€. μμΈν λ΄μ©μ Google Developers MapsDocumentationμ μ°Έμ‘°νμΈμ . κ·Έλμ μ λ μλ‘ λ€λ₯Έ μμμΌλ‘ 5 κ°μ μ΄λ―Έμ§λ₯Ό λ§λ€κ³ μ΄λ¦μ cluster1μμ cluster5λ‘ μ§μ νκ³ assets ν΄λ μμ λ°°μΉνλ κ²μ΄ μ’μ΅λλ€.
@AlexisNi λΉμ μ
google.maps.event.addListener(infoWindow, 'domready', function() {
document.getElementById('info-window-button').addEventListener('click', function(){
// run code here
});
});
μμΈν λ΄μ©μ Google Developers Maps Documention μ μ°Έμ‘°
@joaolbaptista λ―Έμνμ§λ§ Googleμ§λ λ§μ»€μ κ²°ν©νλλΌλ Bootstrapμ λν κ·νμ μ§λ¬Έμ λ΄ μ견μΌλ‘λ μ£Όμ λ₯Ό λ²μ΄λ¬μ΅λλ€. λλ stackoverflow μμ λμΌν μ§λ¬Έ (μ‘°κΈ λ μμΈν)μ μ μ ν κ²μ λλ€.)
@andorfermichael μ€μ λ‘ ν΄λ¬μ€ν° λ΄μ λ§μ»€ μμ λ°λΌ μμ΄μ½μ λ³κ²½νλ κ²μ μλ―Ένμ΅λλ€. κ·Έλμ κΈ°λ³Έ Google μΉ APIλ‘ μ ννμ΅λλ€. ν¬λ§ κ°λμ§λλ ν₯ν ν΄λ¬μ€ν° μλΉμ€λ₯Ό μ 곡 ν κ²μ
λλ€.
μ΄μ¨λ κ³ λ§μ
@ vugar005 κ·Έκ²μ΄ λ΄κ° μ€λͺ νλ €κ³ ν κ²μ λλ€. κΈ°λ³Έ Googleμ§λ APIμ‘°μ°¨λ 5 κ°μ μλ‘ λ€λ₯Έ μ΄λ―Έμ§μ λν κ°λ₯μ± λ§ μ 곡ν©λλ€. μ΄λ¬ν κ° μ΄λ―Έμ§λ νΉμ μκ³ κ°μ λλ¬ ν λ νμλ©λλ€ (μ : cluster1 (m1) 0-10, cluster2 (m2) 11-100 λ±).
μλ νμΈμ @andorfermichael , ν¨ν€μ§λ₯Ό μ κ·Έλ μ΄λ ν ν κ°μκΈ°μ΄ μ€λ₯κ° λ°μνλ μ΄μ λ₯Ό μ μ μμ΅λκΉ?
ReferenceError: MarkerClusterer is not defined
at SafeSubscriber._next (marker-clusterer.ts:106)
at SafeSubscriber.webpackJsonp.../../../../rxjs/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:238)
at SafeSubscriber.webpackJsonp.../../../../rxjs/Subscriber.js.SafeSubscriber.next (Subscriber.js:185)
at Subscriber.webpackJsonp.../../../../rxjs/Subscriber.js.Subscriber._next (Subscriber.js:125)
at Subscriber.webpackJsonp.../../../../rxjs/Subscriber.js.Subscriber.next (Subscriber.js:89)
at SkipWhileSubscriber.webpackJsonp.../../../../rxjs/operator/skipWhile.js.SkipWhileSubscriber._next (skipWhile.js:52)
at SkipWhileSubscriber.webpackJsonp.../../../../rxjs/Subscriber.js.Subscriber.next (Subscriber.js:89)
at TakeSubscriber.webpackJsonp.../../../../rxjs/operator/take.js.TakeSubscriber._next (take.js:80)
at TakeSubscriber.webpackJsonp.../../../../rxjs/Subscriber.js.Subscriber.next (Subscriber.js:89)
at AsyncAction.webpackJsonp.../../../../rxjs/observable/IntervalObservable.js.IntervalObservable.dispatch (IntervalObservable.js:70)
@picosam . λλ μ μμ΄ λ¬Έμ κ° μμλ€. λ¬Έμ λ masterclusterer js νμΌμ κ°μ Έ μ€μ§ μμκ±°λ masterclusterer js νμΌμ κ°μ Έ μ€κΈ° μ μ μ½λκ° Masterclustererλ₯Ό μ¬μ©νλ€λ κ²μ λλ€.
@ vugar005μ κ°μ¬λ립λλ€-μ¬μ€ μ λ κ·Έ μ½λλ₯Ό κ½€ μ€λ«λμ 건λλ¦¬μ§ μμμ΅λλ€! .js
νμΌμ΄ .angular-cli.json
ν¬ν¨λμ΄ μμΌλ©° .ts
νμΌμ import * as ...
λ¬Έμ΄μλ κ²μ μ¬μ€μ
λλ€. λ¬Όλ‘ import
λ¬Έμ μλμΌλ‘ μΆκ°νλ €κ³ ν λ .js
νμ₯μ΄ νμ©λμ§ μλλ€λ μ€λ₯κ° λ°μνμ΅λλ€!
@picosam μ²λ§μμ . λμμ΄λμλ€ λ λ€νμ λλ€.
μ΄ κΈ°λ₯μ μλ‘μ΄ @ agm / js-marker-clusterer ν¨ν€μ§ (# 1044)λ₯Ό ν΅ν΄ μ¬μ©ν μ μμ΅λλ€.
@SebastianM angular-google-mapsμμμ΄ κΈ°λ₯μ μ¬μ©ν μμκ²
@andorfermichael κ·νμ μλ νλ₯ν΄ λ³΄μ λλ€! μλ₯Ό λ€μ΄ μ£Όμ μ κ°μ¬ν©λλ€. κ·νμ μμμ λλ μμΈ νμ΄μ§λ₯Ό ν΅ν΄ Googleμ§λ APIλ₯Ό ν¬ν¨νλ €κ³ νμ§λ§ Googleμ μ°Ύμ μ μκ±°λ λ§μ»€ ν΄λ¬μ€ν° λ¬λ₯Ό μ°Ύμ μ μμ λ±κ³Ό κ°μ μ€λ₯κ° κ³μ λ°μν©λλ€.
@jpcode μλ νμΈμ κ·νμ μ루μ μ κ°μ¬λ립λλ€.νμ§λ§ μ§μλ¬Έμ μ¬μ©νλ©΄ agm-markerμμλ λλ¨Έμ§ μ§μλ₯Ό μ μ΄ ν μ μλ€λ λ¬Έμ κ° μμ΅λλ€. agm-markerμ μΆκ°νλ λ°©λ²μ΄ μμ΅λκΉ? λλ μ§μλ¬Έμ agm-markerμμλ μ΄λ²€νΈλ₯Ό μΆκ°νλ €λ©΄?
κ°μ₯ μ μ©ν λκΈ
@ siegerx3 μλ¦¬κ° λ κ°λ¨ν©λλ€. λ¨Όμ μ¬μ©μ μ μ κ΅¬μ± μμ λλ μ§μλ¬Έμ λ§λλλ€.
ν νλ¦Ώμ΄ νμνμ§ μμκΈ° λλ¬Έμ μ§μλ¬Έμ μ¬μ©νμ΅λλ€. μνλ κ²½μ° κ΅¬μ± μμλ₯Ό μ¬μ©νκ³ μ§μ ν μ μμ΅λλ€.
μ¬μ©μ μ μ κ΅¬μ± μμ / μ§μλ¬Έμ μ¬μ©μ€μΈ κ΅¬μ± μμμ
directives
μΉμ μ μ§μ ν΄μΌνλ κ²μ λΉμ°ν©λλ€. μ΄μ κ΅¬μ± μμλ₯Ό 맡 μμ λμΌμμμ€.Angular2 DIκ° μλνλ λ°©μμΌλ‘ μΈν΄ GoogleMapsAPIWrapper μλΉμ€μ λν 곡κΈμλ₯Ό μ§μ νμ§ μμκΈ° λλ¬Έμ 곡κΈμλ₯Ό μ°Ύμ λκΉμ§ κ΅¬μ± μμ νΈλ¦¬λ‘ μ΄λν©λλ€. μ΄ κ²½μ° ν λ¨κ³ λ μ¬λΌ κ°μΌλ©°
sebm-google-map
κ΅¬μ± μμμ μ 곡λ GoogleMapsAPIWrapperλ₯Ό μ¬μ©ν©λλ€.