1.3.7 • Published 6 years ago
sach-map v1.3.7
Getting Started
npm install sach-map --save
Add google maps api
<script src="http://maps.google.com/maps/api/js?key=YOURKEY"></script>
If you want the placesService included
<script src="http://maps.google.com/maps/api/js?key=YOURKEY&libraries=places"></script>
Import module:
import { MapModule } from 'sach-map';
Add the following in your HTML component:
<div #map id="map"></div>
Add the following in your (s)css component:
#map{
height: 100%;
}
Init google maps:
import {MapService} from 'sach-map';
@ViewChild('map') mapElement: ElementRef;
const lat: number = -34.929;
const long: number = 138.601;
const location = new google.maps.LatLng(lat, long);
const mapOptions = {
center: location,
zoom: 16,
mapTypeId: google.maps.MapTypeId.SATELLITE,
};
const map = this.mapService.init(
this.mapElement,
mapOptions,
true,
YOUR_API_KEY
);
When using markers:
import { MarkerModule } from 'sach-map'; //in your module
{MarkerService} from 'sach-map'; //in your component or service
Add to scripts in angular.json:
"node_modules/@google/markerclustererplus/src/markerclusterer.js"
1.3.7
6 years ago
1.3.6
6 years ago
1.3.5
6 years ago
1.3.4
6 years ago
1.3.3
6 years ago
1.3.2
6 years ago
1.3.1
6 years ago
1.3.0
6 years ago
1.2.5
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.6
6 years ago
1.1.5
6 years ago
1.1.2
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.0
6 years ago
0.0.14
6 years ago
0.0.13
6 years ago
0.0.12
6 years ago
0.0.11
6 years ago
0.0.10
6 years ago
0.0.9
6 years ago
0.0.8
6 years ago
0.0.7
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago