Skip to content
This repository was archived by the owner on Nov 30, 2018. It is now read-only.

Commit 484e69b

Browse files
committed
issue #382
1 parent de7adbb commit 484e69b

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
angular.module("angular-google-maps-example", ["google-maps"]).value("rndAddToLatLon",function () {
2+
return Math.floor(((Math.random() < 0.5 ? -1 : 1) * 2) + 1)
3+
}).controller("controller", function ($scope, $timeout, $log, $http, rndAddToLatLon) {
4+
// Enable the new Google Maps visuals until it gets enabled by default.
5+
// See http://googlegeodevelopers.blogspot.ca/2013/05/a-fresh-new-look-for-maps-api-for-all.html
6+
google.maps.visualRefresh = true;
7+
8+
var versionUrl = window.location.host === "rawgithub.com" ? "http://rawgithub.com/nlaplante/angular-google-maps/master/package.json" : "/package.json";
9+
10+
$http.get(versionUrl).success(function (data) {
11+
if (!data)
12+
console.error("no version object found!!");
13+
$scope.version = data.version;
14+
});
15+
16+
$scope.map = {
17+
center: {
18+
latitude: 51.219053,
19+
longitude: 4.404418
20+
},
21+
zoom: 15
22+
};
23+
24+
$scope.markersClick = function (m) {
25+
26+
};
27+
$scope.map.markers = [
28+
{
29+
longitude: 4.404418,
30+
latitude: 51.219053
31+
}
32+
];
33+
})
34+
.controller('winCtrl', ['$rootScope', '$scope', '$location', '$http',
35+
function ($rootScope, $scope, $location, $http) {
36+
$scope.showSpan = true;
37+
}]);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!DOCTYPE html>
2+
<html xmlns:ng="http://angularjs.org" id='ng-app' ng-app="angular-google-maps-example">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>angular-google-maps example page</title>
6+
<!-- See https://rawgithub.com/ as it returns the correct mimetypes that are requested from github.-->
7+
<!-- make IE Happy , http://docs.angularjs.org/guide/ie -->
8+
<!--[if lte IE 9]>
9+
<script>
10+
window.html5 = {
11+
'elements': 'marker window windows markers layer polyline marker-label ng-controller ng-repeat ng-init ng-model ng-hide ng-show'
12+
};
13+
</script>
14+
15+
<script src="https://rawgithub.com/bestiejs/json3/v3.2.5a/lib/json3.min.js"></script>
16+
<script src="https://rawgithub.com/kriskowal/es5-shim/v2.1.0/es5-shim.min.js"></script>
17+
<script src="https://rawgithub.com/jwmcpeak/EventShim/master/eventShim.js"></script>
18+
<script src="https://rawgithub.com/aFarkas/html5shiv/3.7.0/src/html5shiv.js"></script>
19+
<![endif]-->
20+
21+
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"
22+
type="text/css">
23+
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,800,600,300,700'
24+
rel='stylesheet' type='text/css'>
25+
<link href="assets/stylesheets/example.css" rel="stylesheet" type="text/css">
26+
</head>
27+
28+
<body ng-controller="controller">
29+
<!-- You can use either a div having class 'google-map' or the '<google-map>' element; in
30+
the latter case, uncomment the style above to make sure the custom elements gets block display -->
31+
<div class="page-title ">
32+
<h2 ng-cloak>angular-google-maps example {{version}}</h2>
33+
</div>
34+
<div class="container">
35+
<div class="row">
36+
<button class="col-md-2 btn btn-success" ng-click="map.refresh()">Refresh Map</button>
37+
</div>
38+
<div class="row">
39+
<google-map class="col-md-12"
40+
center="map.center"
41+
zoom="map.zoom"
42+
dragging="map.dragging"
43+
draggable="true"
44+
control="map.control">
45+
<marker ng-repeat="m in map.markers" coords="m" click="m.click()">
46+
<window show="true">
47+
<div class="popup" style="width: 200px; height: 100px;">
48+
<article style="word-wrap: break-word;">{{m}}</article>
49+
<div ng-controller="winCtrl">
50+
<p>showSpan = {{showSpan}}</p>
51+
<span ng-show="showSpan">This won't show..</span>
52+
</div>
53+
</div>
54+
</window>
55+
</marker>
56+
</google-map>
57+
</div>
58+
</div>
59+
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
60+
<script src="http://maps.googleapis.com/maps/api/js?libraries=weather,visualization&sensor=false&language=en&v=3.13"></script>
61+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
62+
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
63+
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js" type="text/javascript"></script>
64+
<script src="../dist/angular-google-maps.js"></script>
65+
<script src="assets/scripts/mocks/heat-layer.js"></script>
66+
<script src="assets/scripts/controllers/issue-382-window-windows-ng-show.js"></script>
67+
<script src="assets/scripts/controllers/templates/info.js"></script>
68+
<script src="http://localhost:35729/livereload.js"></script>
69+
</body>
70+
71+
</html>

0 commit comments

Comments
 (0)