- Basics
- Extended GUI
- Available features
- More
- Reference
- Examples
- Finishing
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.
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"> <fieldset> <label>Default map provider: <select name="mapProvider" locify:selected="$settings[mapProvider]"> <option value="0">Google maps</option> <option value="1">Yahoo maps</option> <option value="2">Mapy.cz</option> </select></label> <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://services.locify.com/showmylocation/submit?width=$client[width]&height=$client[height]" method="post"> <fieldset> <label>Latitude: <input type="text" name="latitude" value="$lat" /></label> <label>Longitude: <input type="text" name="longitude" value="$lon" /></label> <label>Map provider: <select name="mapProvider" locify:selected="$settings[mapProvider]"> <option value="0">Google maps</option> <option value="1">Yahoo maps</option> <option value="2">Mapy.cz</option> </select></label> <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>Show My Location</title> <meta http-equiv="refresh" content="0;url=http://www.locify.com/showmylocation/gm?lat=50.0&lon=14.0&x=220&y=222" /> <locify:call url="locify://internal/http://www.locify.com/showmylocation/gm?lat=50.0&lon=14.0&x=220&y=222" /> </head> <body> </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&mlt=50.0&mln=14.0&resize=s&mag=2&zoomin=yes&ovx=220&ovy=222&ds=n" /> <locify:call url="locify://internal/http://maps.yahoo.com/print.php?ard=1&mlt=50.0&mln=14.0&resize=s&mag=2&zoomin=yes&ovx=220&ovy=222&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=&query=50.0+14.0&mapType=ophoto&zoom=16" /> <locify:call url="locify://external/http://wap.mapy.cz/search?from=&query=50.0+14.0&mapType=ophoto&zoom=16" /> </head> <body> </body> </html>
How does it look like
You need Flash Player and JavaScript to see video content.
