forked from 0x2620/oxjs
more compact label switch for map
This commit is contained in:
parent
007e525162
commit
ce3bdb46d6
3 changed files with 9 additions and 10 deletions
|
|
@ -3,11 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<title>ox.js map demo</title>
|
<title>ox.js map demo</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||||
<link rel="stylesheet" type="text/css" href="../../build/css/ox.ui.css"/>
|
<script type="text/javascript" src="../../build/Ox.js"></script>
|
||||||
<script type="text/javascript" src="../../build/js/jquery-1.5.js"></script>
|
|
||||||
<script type="text/javascript" src="../../build/js/ox.js"></script>
|
|
||||||
<script type="text/javascript" src="../../build/js/ox.ui.js"></script>
|
|
||||||
<script type="text/javascript" src="../../build/js/ox.map.js"></script>
|
|
||||||
<script type="text/javascript" src="js/map.js"></script>
|
<script type="text/javascript" src="js/map.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body></body>
|
<body></body>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
$(function() {
|
Ox.load('UI', {debug: true}, function() {
|
||||||
|
|
||||||
$.getJSON('json/countries.json', function(data) {
|
$.getJSON('json/countries.json', function(data) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -194,13 +194,13 @@ Ox.Map = function(options, self) {
|
||||||
size: 24
|
size: 24
|
||||||
})
|
})
|
||||||
.appendTo(that);
|
.appendTo(that);
|
||||||
self.$labelsButton = new Ox.Button({
|
self.$labelsButton = new Ox.Checkbox({
|
||||||
title: 'Show Labels',
|
title: 'Labels',
|
||||||
width: 96
|
width: 64
|
||||||
})
|
})
|
||||||
.css({float: 'left', margin: '4px'})
|
.css({float: 'left', margin: '4px'})
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
click: toggleLabels
|
change: toggleLabels
|
||||||
})
|
})
|
||||||
.appendTo(self.$toolbar)
|
.appendTo(self.$toolbar)
|
||||||
self.$findInput = new Ox.Input({
|
self.$findInput = new Ox.Input({
|
||||||
|
|
@ -893,11 +893,14 @@ Ox.Map = function(options, self) {
|
||||||
|
|
||||||
function toggleLabels() {
|
function toggleLabels() {
|
||||||
self.options.labels = !self.options.labels
|
self.options.labels = !self.options.labels
|
||||||
|
Ox.print('toggle', getMapType())
|
||||||
self.map.setMapTypeId(google.maps.MapTypeId[getMapType()]);
|
self.map.setMapTypeId(google.maps.MapTypeId[getMapType()]);
|
||||||
|
/*
|
||||||
self.$labelsButton.options({
|
self.$labelsButton.options({
|
||||||
title: self.$labelsButton.options('title') == 'Show Labels' ?
|
title: self.$labelsButton.options('title') == 'Show Labels' ?
|
||||||
'Hide Labels' : 'Show Labels'
|
'Hide Labels' : 'Show Labels'
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
function triggerGeocodeEvent(data) {
|
function triggerGeocodeEvent(data) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue