Sha256: 25b7a4a28ef4521182ef274393b4e05fb48fb04064ff7a743ac2a6cc475191b0

Contents?: true

Size: 1.62 KB

Versions: 6

Compression:

Stored size: 1.62 KB

Contents

<!DOCTYPE html>
<html>
<head>
	<title>Leaflet debug page</title>

	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

	<link rel="stylesheet" href="../../dist/leaflet.css" />

	<link rel="stylesheet" href="../css/mobile.css" />
	<style>
		.mybox {
			background-color: red;
		}

	</style>
	<script type="text/javascript" src="../../build/deps.js"></script>
	<script src="../leaflet-include.js"></script>
</head>
<body>

	<div id="map"></div>

	<script type="text/javascript">

		var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
			cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
			cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution}),
			latlng = new L.LatLng(50.5, 30.51);

		var map = new L.Map('map', {center: latlng, zoom: 15, layers: [cloudmade]});

		//Create a marker, clicking it toggles opacity
		var marker = new L.Marker(latlng, { icon: new L.DivIcon({ className: 'mybox', iconSize: new L.Point(100,100), html: 'opaque. click to toggle' }) });
		map.addLayer(marker);

		var visible = true;
		marker.on('click', function () {
			if (visible) {
				marker.setOpacity(0.3);
				marker._icon.innerHTML = 'transparent';
			} else {
				marker.setOpacity(1);
				marker._icon.innerHTML = 'opaque';
			}
			visible = !visible;
		});

		var marker2 = new L.Marker(new L.LatLng(50.5, 30.52));
		map.addLayer(marker2);
		marker2.bindPopup('This is an amazing message. I shouldn\'t of deleted the Ipsum text');


	</script>
</body>
</html>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
leaflet-js-0.8.dev2 lib/leaflet/debug/tests/opacity.html
leaflet-js-0.7.0.4 lib/leaflet/debug/tests/opacity.html
leaflet-js-0.7.0.3 lib/leaflet/debug/tests/opacity.html
leaflet-js-0.7.0.2 lib/leaflet/debug/tests/opacity.html
leaflet-js-0.7.0.1 lib/leaflet/debug/tests/opacity.html
leaflet-js-0.7.0 lib/leaflet/debug/tests/opacity.html