Last change
on this file since 32796 was 32796, checked in by davidb, 5 years ago |
Initial set of files to provide look and feel of Heritage NZ site, plus SVN clickable map in an iframe
|
-
Property svn:executable
set to
*
|
File size:
1.1 KB
|
Line | |
---|
1 | (function (ng) {
|
---|
2 | angular.module('mapModule')
|
---|
3 | .factory('GoogleMapService', ['$http', function ($http) {
|
---|
4 | var googleMapService = {
|
---|
5 | getRegionNames: function () { return serviceCall(true, '/api/map/GetRegionNames', 'GET', ''); },
|
---|
6 | getTags: function () { return serviceCall(true, '/api/map/GetTags', 'GET', ''); },
|
---|
7 | getAllPlaces: function () { return serviceCall(true, '/api/map/GetPlaces', 'GET', ''); },
|
---|
8 | getPlaces: function (json) { return serviceCall(false, '/api/map/GetPlaces', 'POST', json); },
|
---|
9 | getPlacesNames: function () { return serviceCall(true, '/api/map/GetPlacesNames', 'GET', ''); }
|
---|
10 | };
|
---|
11 |
|
---|
12 | function serviceCall(cacheParam, urlParam, crudType, dataParam) {
|
---|
13 | return $http({ cache: cacheParam, dataType: 'json', url: urlParam, method: crudType, data: dataParam })
|
---|
14 | .then(function (response) {
|
---|
15 | return response.data;
|
---|
16 | });
|
---|
17 | }
|
---|
18 |
|
---|
19 | return googleMapService;
|
---|
20 | }]);
|
---|
21 | })(angular); |
---|
Note:
See
TracBrowser
for help on using the repository browser.