forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.html
147 lines (137 loc) · 4.58 KB
/
map.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<html ng-app="test">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Maps</title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.15&sensor=true®ion=PL&language=pl"></script>
<script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerwithlabel/1.1.9/src/markerwithlabel.js"></script>
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
<script src="../../../../dist/js/ionic.bundle.js"></script>
</head>
<body ng-controller="mainCtrl">
<ion-nav-view></ion-nav-view>
<script id="main.html" type="text/ng-template">
<ion-side-menus>
<!-- Center content -->
<ion-side-menu-content drag-content="false">
<ion-nav-bar class="nav-title-slide-ios7 bar-stable">
<ion-nav-back-button class="button-icon ion-arrow-left-c"></ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>
<ion-nav-buttons side="left">
<button class="button button-icon ion-navicon-round" ng-click="toggleLeft()"></button>
</ion-nav-buttons>
<ion-nav-view name="mainView" animation="slide-left-right"></ion-nav-view>
</ion-pane>
<ion-side-menu side="left">
<ion-header-bar class="bar bar-header bar-positive">
<h1 class="title">Menu</h1>
</ion-header-bar>
<ion-content scroll="false">
<input type="hidden" ng-model="zalogowany">
<div class="list">
<a class="item item-icon-left" nav-clear menu-close href="#/ps/index">
<i class="icon ion-home"></i>
Strona główna
</a>
</div>
</ion-content>
</ion-side-menu>
</ion-side-menus>
</script>
<script id="index.html" type="text/ng-template">
<ion-view title="Issue" right-buttons="rightButtons">
<ion-content has-header="true" padding="false" scroll="true">
<div id="google_maps"></div>
</ion-content>
</ion-view>
</script>
<script id="popup.html" type="text/ng-template">
<label class="item item-radio" ng-repeat="item in opts">
<input type="radio" name="ocena" ng-model="test.option" ng-value="item.id">
<div class="item-content">{{ item.title }}</div>
<i class="radio-icon ion-checkmark"></i>
</label>
</script>
<script>
var AppCtrl = angular.module('test', ['ionic']);
AppCtrl.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
// setup an abstract state for the tabs directive
.state('ps', {
url: "/ps",
abstract: true,
templateUrl: "main.html"
})
.state('ps.index', {
url: '/index',
views: {
"mainView": {
templateUrl: 'index.html',
controller: 'indexCtrl'
}
}
});
// if none of the above states are matched, use this as the fallback
$urlRouterProvider.otherwise('/ps/index');
});
AppCtrl.controller('mainCtrl', function($scope, $ionicSideMenuDelegate) {
$scope.toggleLeft = function() {
$ionicSideMenuDelegate.toggleLeft();
};
});
AppCtrl.controller('indexCtrl', function($scope) {
var poczX = 51.9874;
var poczY = 19.0162;
var poczZoom = 5;
var mapOptions = {
center: new google.maps.LatLng(poczX, poczY),
zoom: poczZoom,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false,
zoomControl: false,
panControl: false,
streetViewControl: false
};
map = new google.maps.Map(document.getElementById("google_maps"), mapOptions);
//google.maps.event.addDomListener(document.getElementById("google_maps"), 'mousedown', function(e) {
//e.preventDefault();
//return false;
//});
var point = new google.maps.LatLng(poczX, poczY);
//var chmurkaText = '<a href="#/ps/atrakcja/' + atrakcja.id + '" class="mapa_chmurka">' + atrakcja.tytul + '</a>';
var div = document.createElement('div');
div.className = "moj-marker";
var s = '<img src="http://img1.polskieszlaki.pl/zdjecia/planer_2014_3/100_100/2-xr-1394795777.jpg">';
div.innerHTML = s;
var image = {
url: "http://img1.polskieszlaki.pl/zdjecia/planer_2014_3/100_100/2-xr-1394795777.jpg",
anchor: new google.maps.Point(28, 28),
};
var marker = new MarkerWithLabel({
position: point,
map: map,
icon: image,
draggable: false,
labelContent: div,
labelAnchor: new google.maps.Point(28, 28),
labelClass: "marker-label", // the CSS class for the label
//chmurka: chmurkaText,
zIndex: 10,
});
console.log(marker);
google.maps.event.addListener(marker, 'click', function() {
console.log("marker");
//chmurka.setContent(this.chmurka);
//chmurka.open(map, this);
});
});
</script>
<style>
#google_maps {
width:100%;
height:500px;
}
</style>
</body>
</html>