View Single Post
YoDude's Avatar
Posts: 2,869 | Thanked: 1,784 times | Joined on Feb 2007 @ Po' Bo'. PA
#16
Originally Posted by sashabe View Post
Great work! BTW, there is a site which uses the same idea: http://finiteloop.org/~btaylor/maps/. It has a search box built-in, but lacks some of rscasas' script features. And customization capabilities of course
I Don't think that search box is right...

Here's one with a search box that works. Copy the quoted text to a note file. Save it as "whatever.HTM" instead of text. Put it on your tablet and go to town.

The code can be customized as described earlier in the thread...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml" style="height:100%">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Search Map -YoDude: LocalSearch Control</title>
<style type="text/css">
@import url("http://www.google.com/uds/css/gsearch.css");
@import url("http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css");
}
</style>
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAzr2EBOXUKnm_ jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"
type="text/javascript"></script>
<script src="http://www.google.com/uds/api?file=uds.js&amp;v=1.0" type="text/javascript"></script>
<script src="http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js" type="text/javascript"></script>
<script type="text/javascript">

function initialize() {
if (GBrowserIsCompatible()) {

// Create and Center a Map
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(40.04,-75.30), 10);
map.addControl(new GLargeMapControl());


// bind a search control to the map, suppress result list
map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(5,5)));
}
}
GSearch.setOnLoadCallback(initialize);
</script>
</head>
<body onload="initialize()" onunload="GUnload()" onresize="onResize()" style="height:100%;margin:0">
<div id="map_canvas" style="width:100%; height:100%;"></div>
</body>
</html>


On the N800 you must tap in the box with your stylus, summon the finger keyboard manually, type your search term, minimize the keyboard, then hit search with the stylus... A bit kludgey but it works work, and hey, what do want for nothin'?

Code shamelessly ganked from Google for non-profit use.

Edit: Cleaned it up and added dynamic map size

Last edited by YoDude; 2008-04-18 at 03:47.
 

The Following User Says Thank You to YoDude For This Useful Post: