⬆️ ⬇️

Geotagging - linking photos to the map

I am sure that the vast majority of habrayuders heard about geotagging, especially those who are interested in photography. For those who have not yet heard, I will explain - in a nutshell, geotagging is the implementation of Exif tags containing information with GPS coordinates in a photo and then linking photos to a map.



The ability to view photos attached to maps is provided by most modern photo hosting sites - PicasaWeb, Flickr, Yandex-Photos and others, and desktop programs are pulling up, for example Picasa.





')

The ideal option for geotagging is the acquisition of special GPS loggers, especially since their prices have been constantly falling lately. The principle of operation of GPS loggers is simple to ugliness - the device periodically resets the current coordinates to a memory card, photos are taken in parallel (preferably with the “masterpiece” function turned on). After the photo session, special software is set on the photos and track from the geo-logger, prescribing GPS coordinates in the photo, synchronizing with time.



You can also use for this purpose a communicator with GPS - the algorithm is similar, although not without drawbacks. For example, the operating time of the communicator, given that it is not specifically sharpened for these purposes, leaves much to be desired. But what to do if there is no magic device, and you still want to attach pictures to the map?



If you still really want to, then you can upload photos to the photo hosting site and manually link them to the map, a minus of this method is that the disk contains photos without coordinates, and doing something manually is not worthy of orthodox IT people / programmers with heightened innate laziness.



Considering all the above, it took about an hour to write simple code to tear out GPS coordinates from the map when you click the mouse and write them in Exif photos.



So, the task can be divided into two stages:

1. Displaying a map on the screen and determining GPS coordinates.

2. Adding tags with GPS coordinates to Exif JPEG file information.



Map output and GPS coordinates determination





To solve this problem using the Google Maps API is much easier than it might seem at first glance.



Create an HTML file with the Google Maps component, stretched to full screen without margin:



<! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  1. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  2. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  3. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  4. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  5. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  6. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  7. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  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:v ="urn:schemas-microsoft-com:vml" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  9. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  10. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  11. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  12. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  13. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  14. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  15. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  16. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  17. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  18. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  19. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  20. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  21. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  22. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  23. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  24. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  25. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  26. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  27. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  28. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  29. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  30. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  31. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  32. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  33. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  34. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  35. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  36. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  37. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  38. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  39. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  40. <! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
<! 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" > < head > < meta http-equiv ="content-type" content ="text/html; charset=UTF-8" /> < title ></ title > < style type ="text/css" > body, html { padding: 0; margin: 0; } #map_canvas { position: absolute; overflow: auto; margin: 0; width: 100%; height: 100%; } </ style > < script src ="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type ="text/javascript" ></ script > <script type= "text/javascript" > var map; function initialize() { // var mapOptions = { } // map = new GMap2( document .getElementById( "map_canvas" ), mapOptions); map.setCenter( new GLatLng(40.1876601,44.5190477), 15); map.setUIToDefault(); } </ script > </ head > < body onload ="initialize()" > < div id ="map_canvas" > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .




* The key for using the Google Maps API can be obtained here , the example uses the key used in the examples in the Maps API documentation.



Load the file into the WebBrowser component (for convenience, I placed the file in the project resources):



  1. webBrowser.AllowWebBrowserDrop = false ;
  2. webBrowser.IsWebBrowserContextMenuEnabled = false ;
  3. webBrowser.WebBrowserShortcutsEnabled = false ;
  4. webBrowser.ObjectForScripting = this ;
  5. webBrowser.DocumentText = Resources.google;
* This source code was highlighted with Source Code Highlighter .




Compiling the application at this stage, we will see the following:







Add a search feature to the map component. To do this, enable the GoogleBar by adding the following code to the initialize () function:



  1. var mapOptions = {
  2. // Search bar settings
  3. googleBarOptions: {
  4. style: "new"
  5. }
  6. }
  7. // Include search string
  8. map.enableGoogleBar ();
* This source code was highlighted with Source Code Highlighter .




Now add a handler for clicking the mouse on the map, for this we define the following function:



  1. // Map Click Handler
  2. function getLatLng (overlay, latlng) {
  3. if (latlng! = null ) {
  4. // Add a pin with coordinates to the map
  5. map.clearOverlays ();
  6. marker = new GMarker (latlng);
  7. map.addOverlay (marker);
  8. marker.openInfoWindowHtml ( '<b> Latitude: </ b>' + latlng.lat () + '<br>' + '<b> Longitude: </ b>' + latlng.lng ());
  9. }
  10. }
* This source code was highlighted with Source Code Highlighter .




And the corresponding listener in the initialize () function:



  1. GEvent.addListener (map, "click" , getLatLng);
* This source code was highlighted with Source Code Highlighter .




The getLatLng () function is pretty simple. First, we clean all the overlays from the map, create a new marker with the coordinates of the place where the user clicked on the map, and finally, for aesthetic reasons, we display a popup with coordinates.



Here's what we got:







Everything looks nice and usable, but how to transfer the data with coordinates to the host application (WinForms with the WebBrowser component)?



To do this, you can use the WebBrowser.ObjectForScripting property. The object assigned to this property is available to scripts in the page as window.external .

I note that the object assigned to the ObjectForScripting property (in this case, the Form object containing the WebBrowser component) must be marked with the ComVisible attribute and only public methods and properties will be available in the scripts.



So, add the following line to the getLatLng () function:



  1. // Transfer Coordinates to Host Application
  2. window.external.SetValue (latlng.lat () + '|' + latlng.lng ());
* This source code was highlighted with Source Code Highlighter .




As I have already said, access to the object assigned by ObjectForScripting is done through window.external, therefore in order for the added code to work you need to add the SetValue (string) method to the public form class:



  1. public void SetValue ( string value )
  2. {
  3. string [] coordinates = value .Split ( '|' );
  4. _latitude = new GPSCoordinate (
  5. Convert .ToDouble (coordinates [0]),
  6. GPSCoordinateType.Latitude);
  7. _longitude = new GPSCoordinate (
  8. Convert .ToDouble (coordinates [1]),
  9. GPSCoordinateType.Longitude);
  10. lblLatitude.Text = _latitude.ToString ();
  11. lblLongitude.Text = _longitude.ToString ();
  12. }
* This source code was highlighted with Source Code Highlighter .




A small digression, in the SetValue method, the GPSCoordinates class is used.



GPSCoordinates class





Google Maps gives the coordinates in decimal form, in Exif the data is written as an array of bytes (more on this below).

The GPSCoordinates class translates decimal GPS coordinates to DMS format (Degrees, Minutes, Seconds).

The GetExifBytes () method returns an array of bytes suitable for writing to Exif, about this in the next part of the article.



  1. internal class GPSCoordinate
  2. {
  3. private readonly double _coord;
  4. public byte Degrees { get ; set ; }
  5. public byte Minutes { get ; set ; }
  6. public double Seconds { get ; set ; }
  7. public char Reference { get ; private set ; }
  8. public GPSCoordinate ( double coord, GPSCoordinateType type)
  9. {
  10. _coord = Math .Abs (coord);
  11. Degrees = ( byte ) _coord;
  12. double minutes = (_coord - Degrees) * 60;
  13. Minutes = ( byte ) minutes;
  14. Seconds = Math .Round ((minutes - Minutes) * 60, 2);
  15. if (type == GPSCoordinateType.Latitude)
  16. Reference = coord <0? 'S' : 'N' ;
  17. else
  18. Reference = coord <0? 'W' : 'E' ;
  19. }
  20. public override string ToString ()
  21. {
  22. Return string .Format ( "{0} {1} ° {2} '{3} \" " , Reference, Degrees, Minutes, Seconds);
  23. }
  24. public byte [] GetExifBytes ()
  25. {
  26. var bytes = new byte [24];
  27. for ( int i = 0; i <24; i ++)
  28. bytes [i] = 0;
  29. bytes [0] = Degrees;
  30. bytes [4] = 1;
  31. bytes [8] = Minutes;
  32. bytes [12] = 1;
  33. int seconds = ( int ) (Seconds * 100);
  34. byte [] temp = BitConverter.GetBytes (seconds);
  35. Array.Copy (temp, 0, bytes, 16, 4);
  36. bytes [20] = 100;
  37. return bytes;
  38. }
  39. }
  40. internal enum GPSCoordinateType
  41. {
  42. Latitude,
  43. Longitude
  44. }
* This source code was highlighted with Source Code Highlighter .








So at the moment we have a working map with search and stretching of coordinates in a form that is suitable for further actions. It remains to write this data into the Exif JPEG file header.



Adding tags to a JPEG file





The Exif 2.2 specification defines a bunch of GPS tags, but for our task we only need to use the following:



Tag NameField nameID (Dec)ID (Hex)TypeBytes count
GPS tag versionGPSVersionID00BYTEfour
North or south latitudeGPSLatitudeRefoneoneASCII2
LatitudeGPSLatitude22RATIONAL3
East or West LongitudeGPSLongitudeRef33ASCII2
LongitudeGPSLongitudefourfourRATIONAL3




The RATIONAL type is defined in the specification as two LONG numbers, the first of which is the numerator, the second is the denominator.

Those. Each of the DMS components of the coordinates is recorded as an 8-byte Rational, which actually makes the GPSCoordinate.GetExifBytes () method.



In .Net, you can get to Exif tags using the Image.PropertyItems property, as well as the Image.GetPropertyItem (int) and Image.SetPropertyItem (PropertyItem) methods. It would seem that you can create a new PropertyItem object to assign all the values ​​and add them to those in the file using the SetPropertyItem (PropertyItem) method.



But it was not there that, for some, undoubtedly compelling reasons, Microsoft closed the designer of this type, so creating a new object with the help of new will not work.



This limitation can, of course, be circumvented with reflection (reflection), but the performance of this approach leaves much to be desired. There is another workaround - create a JPEG “stub” file with GPS tags, then take them out of it using GetPropertyItem, change the data to the ones we need and add to the new file.



This code demonstrates this approach (the stub file has been moved to project resources for convenience):



  1. private void btnWriteTag_Click ( object sender, EventArgs e)
  2. {
  3. if (_image == null || llatitude == null || _longitude == null )
  4. return ;
  5. // GPS Tag Version
  6. PropertyItem pitem = CreateNewPropertyItem (0x0);
  7. pitem.Value [0] = 2;
  8. pitem.Value [1] = 2;
  9. _image.SetPropertyItem (pitem);
  10. // Latitude
  11. pitem = CreateNewPropertyItem (0x2);
  12. pitem.Value = _latitude.GetExifBytes ();
  13. _image.SetPropertyItem (pitem);
  14. // LatitudeRef (North or South)
  15. pitem = CreateNewPropertyItem (0x1);
  16. pitem.Value [0] = ( byte ) _latitude.Reference;
  17. _image.SetPropertyItem (pitem);
  18. // Longitude
  19. pitem = CreateNewPropertyItem (0x4);
  20. pitem.Value = _longitude.GetExifBytes ();
  21. _image.SetPropertyItem (pitem);
  22. // LatitudeRef (East or West)
  23. pitem = CreateNewPropertyItem (0x3);
  24. pitem.Value [0] = ( byte ) _longitude.Reference;
  25. _image.SetPropertyItem (pitem);
  26. }
  27. private static PropertyItem CreateNewPropertyItem ( int id)
  28. {
  29. return Resources.gps_jpg.GetPropertyItem (id);
  30. }
* This source code was highlighted with Source Code Highlighter .




Of course, both methods (described above, and on the basis of reflection) are not very aesthetic, maybe in the future, MS will provide an opportunity to create PropertyItem objects and these crutches will no longer be needed.



We just need to save the file with new tags:



  1. if (_saveFileDialog.ShowDialog () == DialogResult.OK)
  2. {
  3. _image.Save (_saveFileDialog.FileName);
  4. }
* This source code was highlighted with Source Code Highlighter .




By the way, these changes do not lead to the need to transcode the file, because they concern only meta-information.



Epilogue





Well, that's all. It remains to add that the coordinates recorded in the files as a result of the files are quietly determined by Flickr and Yandex Photos, for some reason PicasaWeb does not want to understand the coordinates, although the desktop Picasa has no such problems.

Having rummaged in the network, I found a lot of bug reports with the same problem, most likely a problem with PicasaWeb, although no one except those who suffer from bug reports has been unsubscribed.



Project sources can be downloaded here .



ATTENTION: In the example there are no checks for everything that is possible, the code was written in an hour and is not a ready program for geotagging, rather a proof-of-concept, so make backups. The editors are not responsible for the safety of photos;)



PS By the way, there is a great tool for geotagging - GeoSetter , understands a bunch of formats, including RAW (although the merit is rather the well-known ExifTool written by Phil Harvey).

Source: https://habr.com/ru/post/79741/



All Articles