This Project is nolonger maintained
Angular Direction Service
Google Maps direction service for nearby places from a location
Google maps provides services using which one can know what are the nearby places and some other information like distance and time to travel to those nearby places from a particular location and these API's are used in many websites .But to create an entire view and functionality one needs to write code for the same .Since this functionality is increasingly used writing code for this functionality would be like spending time on something which was already developed but not availabe .
Using bower :
#install package and add it to bower.json dependencies $ bower install angular-direction-service --save
Direction Service Elements
List of directives provided by dsmapservice
- dsMap (required) : Parent directive which controls all the child(below 2-5) directives.
- dsMapView (optional - Only if map is to be shown) : Directive to show map on page which will be linked to places directives(below 3-4).
- dsMapPlaces (required) : Parent directive which controls all places.
- dsGroup (requred) : Directive to handle functionalites for groups.
- dsPlacesType (required) : Directive which shows nearby places based on type/types passed to it.
Of the above metioned directives three directives dsMapView, dsMapPlaces and dsPlacesType also have attributes which is available to customize the map:
- map-settings : Configurations for map
- origin-options : Configure origin marker
- destination-options : Configure destination marker
- options : Configure properties like 'preserveViewport', 'suppressMarkers'...
- group : Specify within which group the marker of the types specified are in
- types : Specify type(Array)/types(Object)
- options : Configure nearby places marker
Also you need to provide a template which is needed to render each place with id as "dsMapPlaces.html". Example template :
<script type="text/ng-template" id="dsMapPlaces.html"> <div> <div class="commute__item" ng-repeat="place in Places | limitTo:5" ng-mouseover="showDirection()" ds-each-place> <label ng-bind="place.name"></label> <span ng-bind="place.distance + ' km'"></span> <div><i class="car-icon-grey"></i><span ng-bind="place.duration+ ' min'"></span></div> </div> </div> </script>
The MIT License (MIT)
Copyright (c) 2015 Zword
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.