more compact label switch for map

This commit is contained in:
rolux 2011-05-21 09:08:52 +02:00
parent 007e525162
commit ce3bdb46d6
3 changed files with 9 additions and 10 deletions

View file

@ -3,11 +3,7 @@
<head>
<title>ox.js map demo</title>
<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/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="../../build/Ox.js"></script>
<script type="text/javascript" src="js/map.js"></script>
</head>
<body></body>

View file

@ -1,4 +1,4 @@
$(function() {
Ox.load('UI', {debug: true}, function() {
$.getJSON('json/countries.json', function(data) {

View file

@ -194,13 +194,13 @@ Ox.Map = function(options, self) {
size: 24
})
.appendTo(that);
self.$labelsButton = new Ox.Button({
title: 'Show Labels',
width: 96
self.$labelsButton = new Ox.Checkbox({
title: 'Labels',
width: 64
})
.css({float: 'left', margin: '4px'})
.bindEvent({
click: toggleLabels
change: toggleLabels
})
.appendTo(self.$toolbar)
self.$findInput = new Ox.Input({
@ -893,11 +893,14 @@ Ox.Map = function(options, self) {
function toggleLabels() {
self.options.labels = !self.options.labels
Ox.print('toggle', getMapType())
self.map.setMapTypeId(google.maps.MapTypeId[getMapType()]);
/*
self.$labelsButton.options({
title: self.$labelsButton.options('title') == 'Show Labels' ?
'Hide Labels' : 'Show Labels'
});
*/
}
function triggerGeocodeEvent(data) {