Show My Location

This sample service allows user to get his position and view it on on-line maps. Service supports Google Maps, Yahoo Maps and Mapy.cz. Google Maps and Yahoo Maps are opened in internal browser, Mapy.cz are opened in external browser. This service also uses settings for remembering default map provider. Service acquire information about width and height of user's cell phone using variable $client[width] and $client[height] - it is used for generating map of right size.

Function of this service is built in Locify client since version 0.9 as Maps. Service is no longer listed in public services, but you can install it from this link for developer purposes.

Welcome message

<?xml version="1.0" encoding="utf-8" ?>
<!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:locify="http://client.locify.com/locify_ns/1.0" xml:lang="en" lang="en">
<head>
	<title>Show my location</title>
</head>
<body class="serviceInfo">
	<div>
		<p class="description">This service enables user to view his position on Google, Yahoo or Seznam Maps using external browser.</p>
		<img src="http://www.locify.com/images/icons/location.png" class="icon" alt="" />
		<a href="http://services.locify.com/showmylocation/start" class="firstScreen">firstScreen</a>
		<a href="http://services.locify.com/showmylocation/settings" class="settings">settings</a>
	</div>
</body>
</html>

Settings screen

<?xml version="1.0" encoding="utf-8" ?>
<!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:locify="http://client.locify.com/locify_ns/1.0" xml:lang="en" lang="en">
<head>
	<title>Show My Location settings</title>
</head>
<body class="form">
<form action="locify://serviceSettings" method="post">
	<locify:variables>
		<locify:element name="mapProvider" value="$settings[mapProvider]" />
	</locify:variables>
	<fieldset>
	<label>Default map provider: <select name="mapProvider">
		<option value="0" selected="selected">Google maps</option>
		<option value="4">Google satellite</option>
		<option value="5">Google hybrid</option>
		<option value="6">Google terrain</option>
		<option value="1">Yahoo maps</option>
		<option value="2">Mapy.cz</option>
		<option value="3">OpenStreetMap.org</option>
	</select></label><br />
	<input type="submit" value="Save" />
	</fieldset>
</form>
</body>
</html>

First screen

<?xml version="1.0" encoding="utf-8" ?>
<!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:locify="http://client.locify.com/locify_ns/1.0" xml:lang="en" lang="en">
<head>
	<title>Show My Location</title>
</head>
<body class="form">
<form action="http://labs.locify.com/showmylocation/submit?width=$client[width]&amp;height=$client[height]" method="post">
	<locify:variables>
		<locify:element name="latitude" value="$lat" />
		<locify:element name="longitude" value="$lon" />
		<locify:element name="mapProvider" value="$settings[mapProvider]" />
	</locify:variables>
	<fieldset>
	<locify:where />
	<input type="text" name="latitude" value="" />
	<input type="text" name="longitude" value="" />
	<label>Map provider: <select name="mapProvider">
		<option value="0" selected="selected">Google maps</option>
		<option value="4">Google satellite</option>
		<option value="5">Google hybrid</option>
		<option value="6">Google terrain</option>
		<option value="1">Yahoo maps</option>
		<option value="2">Mapy.cz</option>
		<option value="3">OpenStreetMap.org</option>
	</select></label><br />
 
	<input type="submit" value="Show map" />
	</fieldset>
</form>
</body>
</html>

Answer to submitted form in first screen

This example shows the position on maps if user is located at coordinates N 50° E 14° and have selected:

Google Maps

<?xml version="1.0" encoding="utf-8" ?>
<!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:locify="http://client.locify.com/locify_ns/1.0" xml:lang="en" lang="en">
<head>
	<title>My Location at Google Maps</title>
</head>
<body>
<div>
<img src="http://maps.google.com/staticmap?markers=50.0,14.0&amp;size=220x290&amp;maptype=mobile&amp;key=Locify-google-key" alt="Google Map">
</div>
</body>
</html>

Yahoo Maps

<?xml version="1.0" encoding="utf-8" ?>
<!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:locify="http://client.locify.com/locify_ns/1.0" xml:lang="en" lang="en">
  <head>
  	<title>Show My Location</title>
    <meta http-equiv="refresh" content="0;url=http://maps.yahoo.com/print.php?ard=1&amp;mlt=50.0&amp;mln=14.0&amp;resize=s&amp;mag=2&amp;zoomin=yes&amp;ovx=220&amp;ovy=222&amp;ds=n" />
  </head>
  <body>
  </body>
</html>

Mapy.cz

<?xml version="1.0" encoding="utf-8" ?>
<!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:locify="http://client.locify.com/locify_ns/1.0" xml:lang="en" lang="en">
  <head>
  	<title>Show My Location</title>
    <meta http-equiv="refresh" content="0;url=http://wap.mapy.cz/search?from=&amp;query=50.0+14.0&amp;mapType=ophoto&amp;zoom=16" />
    <locify:call url="locify://external/http://wap.mapy.cz/search?from=&amp;query=50.0+14.0&amp;mapType=ophoto&amp;zoom=16" />
  </head>
  <body>
  </body>
</html>

How does it look like

You need Flash Player and JavaScript to see video content.