angularjs-module-googleMaps

My Module to use GoogleMaps on angularJs

Added by: Sam Deering

GitHub

Repository

saulburgos/angularjs-module-googlemaps

Stats

Stars: 0

Watchers: 0

Forks: 1

Module Description

angularjs-Module-GoogleMaps

Module to use Google Maps like a service. I like use Google maps like a service and not like a directive, because I need use a lot of geometry methods. the following are a series a methods that I commonly used in my projects.

List of Methods:

  • addCustomMethods
  • activeDrawingMode
  • attachEventToElement
  • calculateCircleArea
  • calculateAreaRectangle
  • calculateAreaPolygon
  • calculateTotalDistancePolyline
  • calculateDistanceBetween2Points
  • centerMapOnPoints
  • createPolygon
  • createPolyline
  • createRectangle
  • createCircle
  • createMarkers
  • createAutocomplete
  • updateMap
  • deserializeCircle
  • deserializePolygon
  • deserializePolyline
  • deserializeMvcArray
  • deserializeRectangle
  • deserializeMaker
  • serializeMap
  • serializeCircle
  • serializePolygon
  • serializePolyline
  • serializeMvcArray
  • serializeRectangle
  • serializeMarker
  • geolocateUser
  • getBoundsFromString
  • getRandomPositionByBounds
  • generateRandomMarkers
  • showMarkers
  • removeMarkers
  • removeDrawingMode
  • removeDrawingMode
  • restrictBounds
  • loadMap
  • openInfoWindow

##Setup:

Load the module in your index.html

<script src="googleMapsSrv.js"></script>

Inject the module:

angular.module('myApp', [
  'googleMapsSrv'
])

Inject the service in your controler:

.controller('MyCtrl1', function($scope,googleMapsService) {

    $scope.$on('$viewContentLoaded', function() {
        $scope.mapSrv = new googleMapsService(document.querySelector('#googleMap'),$scope);
        $scope.mapSrv.googleMapsLoaded.then(function() {
               $scope.mapSrv.loadMap();     
        });
    });

});

Demo here demo

Module stats last updated: 2015-04-19 02:18:35

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!