Add trivial maps facilitator at about:maps

This is a simple HTML front end for the Google Static Maps API, since
we don't yet have enough JS support for the full Google Maps.

See:
  https://developers.google.com/maps/documentation/staticmaps/
This commit is contained in:
Michael Drake 2014-10-22 20:39:43 +01:00
parent dc5deb26b1
commit 6b846c363d
10 changed files with 110 additions and 3 deletions

View File

@ -0,0 +1,85 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>NetSurf: Static Maps</title>
<style type="text/css">html,body{margin:0;padding:0;}body{color:#000;background:#fff;font-family:sans-serif;margin:0 auto;}a:link{text-decoration:underline;color:#00f;}a:visited{text-decoration:underline;color:#60a;}a:hover{text-decoration:none;}a:active{text-decoration:underline;color:#f00;}.banner{margin:0;padding:0;background:#94adff;text-align:left;}.banner img{border:none;color:#000;height:86px;width:308px;display:block;}.onlycontent{margin:0 1em;}.nslinks{display:table;width:100%;margin:0;border-spacing:0;padding:0;background:#ccd8ff;font-size:94%;}.nslinks li{display:table-cell;text-align:center;padding:0.2em 0.3em 0.3em;vertical-align:middle;}.nslinks li+li{border-left:2px solid #b1c3ff;}.version{padding:0;margin:1.2em auto 0;width:90%;color:#444;font-size:160%;}.intro{width:90%;margin:1em auto;color:#666;}.websearch{margin:1.5em auto;padding:0 0.3em 1.2em;background:#d8e2ff;border:2px solid #c5d3ff;width:80%;text-align:center;}.websearch p {text-align:left;color:#8c93a6;margin-left:1em; }.websearch input[type=text]{border:2px solid #b6c7ff;background:#f9faff;color:#000;margin:2px;}.websearch input[type=submit]{border:2px outset #cedaff;color:#000;background:#cedaff;margin:2px;}.footer{font-style:italic;color:#666;text-align:right; clear: both;}.footer p{margin-top:1.5em;padding-top:0.4em;border-top:2px solid #94adff;}.options {display:table;width:80%;margin:1.2em auto 3em; }.options-col {display:table-cell;}.options-col table {margin:0 auto;}</style>
</head>
<body>
<h1 class="banner"><a href="http://www.netsurf-browser.org/"><img src="about:logo" alt="NetSurf"></a></h1>
<ul class="nslinks">
<li><a href="http://www.netsurf-browser.org/">NetSurf web&nbsp;site</a></li>
<li><a href="http://www.netsurf-browser.org/documentation/">Documentation</a></li>
<li><a href="http://www.netsurf-browser.org/downloads/">Download latest NetSurf</a></li>
<li><a href="http://www.netsurf-browser.org/contact/">Contact the developers</a></li>
</ul>
<div class="onlycontent">
<h2 class="version">Static Maps</h2>
<p class="intro">Since NetSurf does not yet have enough JavaScript support
to handle most mapping sites on the web, we provide here a simple interface
to Google's Static Maps API.</p>
<form method="get" action="https://maps.googleapis.com/maps/api/staticmap">
<div class="websearch">
<dl>
<p>Example: <em>Oxford Street, London, UK</em></p>
<input name="center" size="42" maxlength="255" type="text">
<input type="submit" value="View Map!">
</div>
<div class="options">
<div class="options-col">
<table>
<tr><td>Size</td><td><input name="size" size="10" maxlength="255" type="text" value="400x400"></td></tr>
<tr><td>Scale</td><td><input type="radio" name="scale" value="1" checked>Standard<br>
<input type="radio" name="scale" value="2">Double</td></tr>
</table>
</div>
<div class="options-col">
<table>
<tr><td>Zoom</td><td><select name="zoom">
<option value="0">Whole planet</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16" selected>16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">Really close</option>
</select></td></tr>
<tr><td>Type</td><td><select name="maptype">
<option value="roadmap" selected>Road map</option>
<option value="satellite">Satellite</option>
<option value="terrain">Terrain</option>
<option value="hybrid">Hybrid</option>
</select></td></tr>
</table>
</div>
</div>
</form>
<div class="footer">
<p>NetSurf is licensed under the GNU Public Licence version 2</p>
</div>
</div>
</body></html>

View File

@ -199,6 +199,7 @@ endif
$(Q)cp \!NetSurf/Resources/ca-bundle $(ATARI_TARGET_DIR)res/cabundle
$(Q)$(SPLIT_MESSAGES) -l en -p atari -f messages resources/FatMessages > $(ATARI_TARGET_DIR)res/messages
$(Q)cp \!NetSurf/Resources/en/welcome.html,faf $(ATARI_TARGET_DIR)res/welcome.html
$(Q)cp \!NetSurf/Resources/en/maps.html,faf $(ATARI_TARGET_DIR)res/maps.html
$(Q)cp \!NetSurf/Resources/en/licence.html,faf $(ATARI_TARGET_DIR)res/licence.html
$(Q)cp \!NetSurf/Resources/en/credits.html,faf $(ATARI_TARGET_DIR)res/credits.html

View File

@ -110,7 +110,7 @@ RDEF_IMP_BEOS := $(addprefix $(OBJROOT)/,$(subst /,_,$(RDEF_IMP_BEOS)))
RDEP_BEOS := \
adblock.css beosdefault.css default.css internal.css quirks.css \
netsurf.png favicon.png ca-bundle.txt \
credits.html licence.html welcome.html
credits.html licence.html welcome.html maps.html
RDEP_BEOS := $(addprefix beos/res/,$(RDEP_BEOS)) \
$(wildcard beos/res/icons/*.png) \
$(wildcard beos/res/??/*) \

View File

@ -572,6 +572,21 @@ static bool fetch_about_welcome_handler(struct fetch_about_context *ctx)
return true;
}
static bool fetch_about_maps_handler(struct fetch_about_context *ctx)
{
fetch_msg msg;
/* content is going to return redirect */
fetch_set_http_code(ctx->fetchh, 302);
msg.type = FETCH_REDIRECT;
msg.data.redirect = "resource:maps.html";
fetch_about_send_callback(&msg, ctx);
return true;
}
/* Forward declaration because this handler requires the handler table. */
static bool fetch_about_about_handler(struct fetch_about_context *ctx);
@ -593,6 +608,8 @@ struct about_handlers about_handler_list[] = {
fetch_about_licence_handler, true },
{ "welcome", SLEN("welcome"), NULL,
fetch_about_welcome_handler, false },
{ "maps", SLEN("maps"), NULL,
fetch_about_maps_handler, false },
{ "config", SLEN("config"), NULL,
fetch_about_config_handler, false },
{ "Choices", SLEN("Choices"), NULL,

View File

@ -83,6 +83,7 @@ static const char *fetch_resource_paths[] = {
"credits.html",
"licence.html",
"welcome.html",
"maps.html",
"favicon.ico",
"default.ico",
"netsurf.png",

View File

@ -186,7 +186,7 @@ EXETARGET := nsfb
NETSURF_FRAMEBUFFER_RESOURCE_LIST := adblock.css credits.html \
default.css internal.css licence.html \
netsurf.png quirks.css welcome.html Messages
netsurf.png quirks.css welcome.html maps.html Messages
install-framebuffer:
$(Q)mkdir -p $(DESTDIR)$(NETSURF_FRAMEBUFFER_BIN)

1
framebuffer/res/maps.html Symbolic link
View File

@ -0,0 +1 @@
../../!NetSurf/Resources/en/welcome.html,faf

View File

@ -127,7 +127,7 @@ EXETARGET := nsgtk
GTK_RESOURCES_LIST := \
languages themelist SearchEngines toolbarIndices ca-bundle.txt \
default.css adblock.css quirks.css internal.css gtkdefault.css \
credits.html licence.html welcome.html Messages \
credits.html licence.html welcome.html maps.html Messages \
default.ico favicon.png netsurf.png netsurf.xpm netsurf-16x16.xpm \
arrow_down_8x32.png

1
gtk/res/en/maps.html Symbolic link
View File

@ -0,0 +1 @@
../../../!NetSurf/Resources/en/maps.html,faf

1
gtk/res/maps.html Symbolic link
View File

@ -0,0 +1 @@
en/maps.html