PageSourceSearch

https://www.montgomeryohio.gov/wp-content/plugins/wp-proud-map-app/includes/js/proud-map-app.js?ver=7.1.2

js montgomeryohio.gov collected 2026-10-02 03:38:11 UTC 3,749 bytes, 106 lines download raw bytes

1// The maps object
2angular.module('mapAppParent', [
3  'ProudBase',
4  'ProudMaps'
5])
6
7.config(
8  [ '$stateProvider', '$urlRouterProvider', 'MapsProvider', 'MapsRoutesProvider',
9    function ($stateProvider, $urlRouterProvider, MapsProvider, MapsRoutesProvider) {  
10      var id = MapsProvider.getMapId();
11      $stateProvider.state("maps", {
12        template: '<div class="fadeonly" ui-view></div>',
13        data: { 
14          doScroll: false,  // No scroll on route change
15          undoMainToggle: false,   // Force "offcanvas" class off
16          title: 'View map'
17        },
18        resolve: {
19          layers: function($rootScope, $q, $http, Post) {
20            // re-init the map, pass all the required objects
21            MapsProvider.init({}, $rootScope, $q, $http, Post);
22            return MapsProvider.getLayers();
23          },
24        },
25        url: "/maps-" + id,
26        controller: function($scope, $rootScope, $state, layers){
27          $scope.layerLoading = false;
28          $scope.layers = layers;
29          $scope.currentLayer = null;
30
31          // Init listeners
32          $rootScope.setWatchers($scope, {
33            // Listen for loading
34            'maps-layer-loading': function(event, loading) {
35              $scope.layerLoading = loading;
36            },
37
38            // Layer done
39            'maps-layer-change': function(event, args) {
40              $scope.currentLayer = args.layer;
41            }
42          });
43        }
44      });
45      // Attach our maps sub-routing
46      MapsRoutesProvider.attachRoutes('maps', $stateProvider, MapsProvider);    
47    }
48  ]
49)
50
51// Isotope social wall
52.directive('mapParent', function($rootScope, $state, Maps, $location) {
53  return {
54    restrict: 'A',
55    template: '<div class="fadeonly" ui-view></div>',
56    link: function() {
57       // Initial page load / or no path ? Redirect if applicable
58      if(!$state.current || !$state.current.name) {
59        var mapId = Maps.getMapId();
60        // Basically we want to goto state (silently) if there
61        // 1. is none
62        // 2. only has 1 path element (since everything is at least maps/map)
63        // 3. none of the routes are matched
64        var paths = $location.$$path.length > 1 ? $location.$$path.substring(1).split('/').filter(function(n){ return n; }) : [];
65        var shouldRedirect = !paths.length || paths.length < 2 || !lodash.filter($state.get(), function(state) {
66            return state.url && state.url.substring(1) === paths[0];
67        }).length;
68        if(shouldRedirect) {
69          $state.go('maps.mapview', {}, {location: false});
70        }
71      }
72    }
73  }
74});
75
76(function($, Proud) {
77  Proud.behaviors.proud_map_app = {
78    attach: function(context, settings) {
79      var instances = lodash.get(settings, 'proud_map_app.instances');
80      // initialize instances
81      if (instances) {
82        $.each(instances, function(id, appVals) {
83          // Deal with converting old settings
84          appVals['include_map_filters'] = true;
85          if( appVals['source'] === 'foursquare' ) {
86            appVals['source'] = 'google';
87          }
88          // Value could be false or 0
89          if( appVals['map_has_overlay'] !== false && appVals['map_has_overlay'] != 0 ) {
90            appVals['map_has_overlay'] = true;
91            appVals['map_style_display'] = 'fullscreen';
92          } else {
93            appVals['map_has_overlay'] = false;
94            appVals['map_style_display'] = 'normal';
95          }
96          // Set values
97          lodash.set(Proud, 'settings.proud_map_app.instances.' + id, appVals);
98          var $app = $('#' + id);
99          if(!$app.hasClass('ng-scope')) {
100            angular.bootstrap($app, ['mapAppParent']);
101          }
102        });
103      }
104    }
105  }
106})(jQuery, Proud);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.