1.3.7 • Published 5 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
5 years ago
1.3.6
5 years ago
1.3.5
5 years ago
1.3.4
5 years ago
1.3.3
5 years ago
1.3.2
5 years ago
1.3.1
5 years ago
1.3.0
5 years ago
1.2.5
5 years ago
1.2.2
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago
1.1.6
5 years ago
1.1.5
5 years ago
1.1.2
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.0
5 years ago
0.0.14
5 years ago
0.0.13
5 years ago
0.0.12
5 years ago
0.0.11
5 years ago
0.0.10
5 years ago
0.0.9
5 years ago
0.0.8
5 years ago
0.0.7
5 years ago
0.0.6
5 years ago
0.0.5
5 years ago
0.0.4
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago