This repository has been archived by the owner on Dec 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
R Conner Howell
committed
Aug 10, 2017
1 parent
9af421c
commit 0e3a638
Showing
5 changed files
with
196 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ | |
Luke Mahé <[email protected]> | ||
Chris Broadfoot <[email protected]> | ||
Brendan Kenny <[email protected]> | ||
Robert Howell <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | ||
<title>Map Label Utility Library Example With Background</title> | ||
<style> | ||
body { | ||
font-family: sans-serif; | ||
} | ||
</style> | ||
<script src="https://maps.googleapis.com/maps/api/js"></script> | ||
<script src="../src/maplabel.js"></script> | ||
|
||
<script> | ||
function init() { | ||
var myLatlng = new google.maps.LatLng(34.04, -118.24); | ||
var myOptions = { | ||
zoom: 13, | ||
center: myLatlng, | ||
mapTypeId: google.maps.MapTypeId.ROADMAP | ||
}; | ||
|
||
var map = new google.maps.Map(document.getElementById('map'), myOptions); | ||
|
||
var mapLabel = new MapLabel({ | ||
text: 'Background!', | ||
position: new google.maps.LatLng(34.03, -118.235), | ||
map: map, | ||
fontSize: 20, | ||
fontColor: '#fff', | ||
strokeWeight: 1.0, | ||
strokeColor: '#01579B', | ||
backgroundColor: '#0288D1', | ||
borderRadius: 10, | ||
padding: 10, | ||
backgroundStrokeColor: '#01579B', | ||
backgroundStrokeWeight: 3 | ||
}); | ||
mapLabel.set('position', new google.maps.LatLng(34.03, -118.235)); | ||
|
||
var marker = new google.maps.Marker(); | ||
marker.bindTo('map', mapLabel); | ||
marker.bindTo('position', mapLabel); | ||
marker.setDraggable(true); | ||
|
||
var map2 = new google.maps.Map(document.getElementById('map2'), myOptions); | ||
|
||
var changeText = document.getElementById('change-text'); | ||
google.maps.event.addDomListener(changeText, 'click', function() { | ||
mapLabel.set('text', document.getElementById('text').value); | ||
}); | ||
|
||
|
||
var move = document.getElementById('move'); | ||
google.maps.event.addDomListener(move, 'click', function() { | ||
mapLabel.setMap(mapLabel.getMap() === map ? map2 : map); | ||
}); | ||
} | ||
|
||
google.maps.event.addDomListener(window, 'load', init); | ||
</script> | ||
<script> | ||
var _gaq = _gaq || []; | ||
_gaq.push(['_setAccount', 'UA-12846745-20']); | ||
_gaq.push(['_trackPageview']); | ||
|
||
(function() { | ||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | ||
ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | ||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | ||
})(); | ||
</script> | ||
</head> | ||
<body> | ||
<h1>Map Label Utility Library - With Background</h1> | ||
<div id="map" style="width: 500px; height: 500px; float: left"></div> | ||
<div id="map2" style="width: 500px; height: 500px; float: left; margin-left: 20px;"></div> | ||
<div style="clear: both; padding-top: 10px;"> | ||
<label>Map:</label> | ||
<button id="move">Toggle Maps</button> | ||
</div> | ||
<label>Text:</label> | ||
<input type="text" id="text" value="foo"> | ||
<button id="change-text">Change Text</button> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,4 +133,4 @@ <h1>Map Label Utility Library</h1> | |
<button id="change-align">Align</button> | ||
</div> | ||
</body> | ||
</html> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters