embed_google_map_page

The Embed Google Map embed google map page function.

Description

embed_google_map_page(); 

Usage

  1. if ( !function_exists( 'embed_google_map_page' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'embed-google-map/embed_google_map.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = embed_google_map_page(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/embed_google_map.php  
  1. function embed_google_map_page() { 
  2. screen_icon(); 
  3. ?> 
  4. <div class="wrap"> 
  5. <h2>Embed Google Map Settings</h2> 
  6. <p> 
  7. Embed Google Map is a plugin for embedding one or more Google Maps to WordPress posts and pages. Adding maps is very simple, just add the address or the coordinates which location you want to show an a map inside google_map tags to a post or a page, and that's it! 
  8. </p> 
  9. <p> 
  10. It's possible to define the type of the map (normal, satellite, hybrid, terrain), the size of the map, the language of the Google Maps interface, zoom level, border width and link to the full size map. The settings defined in this page are the default settings used for all the maps in the site, and they can be overridden for individual maps. 
  11. </p> 
  12. <form method="post" action="options.php"> 
  13. <?php  
  14. settings_fields('embed_google_map-settings-group'); 
  15. $options = get_option('embed_google_map_options'); 
  16. init_options($options); 
  17. ?> 
  18. <table class="form-table"> 
  19. <tr valign="top"> 
  20. <th scope="row">Map type:</th> 
  21. <td> 
  22. <select name="embed_google_map_options[map_type]"> 
  23. <option value="m" <? echo ($options['map_type'] == "m") ? 'selected="selected"' : ''; ?>>Normal map</option> 
  24. <option value="k" <? echo ($options['map_type'] == "k") ? 'selected="selected"' : ''; ?>>Satellite</option> 
  25. <option value="h" <? echo ($options['map_type'] == "h") ? 'selected="selected"' : ''; ?>>Hybrid</option> 
  26. <option value="p" <? echo ($options['map_type'] == "p") ? 'selected="selected"' : ''; ?>>Terrain</option> 
  27. </select> 
  28. </td> 
  29. </tr> 
  30. <tr valign="top"> 
  31. <th scope="row">Zoom level:</th> 
  32. <td> 
  33. <select name="embed_google_map_options[zoom_level]"> 
  34. <option value="0" <? echo ($options['zoom_level'] == "0") ? 'selected="selected"' : ''; ?>>0</option> 
  35. <option value="1" <? echo ($options['zoom_level'] == "1") ? 'selected="selected"' : ''; ?>>1</option> 
  36. <option value="2" <? echo ($options['zoom_level'] == "2") ? 'selected="selected"' : ''; ?>>2</option> 
  37. <option value="3" <? echo ($options['zoom_level'] == "3") ? 'selected="selected"' : ''; ?>>3</option> 
  38. <option value="4" <? echo ($options['zoom_level'] == "4") ? 'selected="selected"' : ''; ?>>4</option> 
  39. <option value="5" <? echo ($options['zoom_level'] == "5") ? 'selected="selected"' : ''; ?>>5</option> 
  40. <option value="6" <? echo ($options['zoom_level'] == "6") ? 'selected="selected"' : ''; ?>>6</option> 
  41. <option value="7" <? echo ($options['zoom_level'] == "7") ? 'selected="selected"' : ''; ?>>7</option> 
  42. <option value="8" <? echo ($options['zoom_level'] == "8") ? 'selected="selected"' : ''; ?>>8</option> 
  43. <option value="9" <? echo ($options['zoom_level'] == "9") ? 'selected="selected"' : ''; ?>>9</option> 
  44. <option value="10" <? echo ($options['zoom_level'] == "10") ? 'selected="selected"' : ''; ?>>10</option> 
  45. <option value="11" <? echo ($options['zoom_level'] == "11") ? 'selected="selected"' : ''; ?>>11</option> 
  46. <option value="12" <? echo ($options['zoom_level'] == "12") ? 'selected="selected"' : ''; ?>>12</option> 
  47. <option value="13" <? echo ($options['zoom_level'] == "13") ? 'selected="selected"' : ''; ?>>13</option> 
  48. <option value="14" <? echo ($options['zoom_level'] == "14" || !isset($options['zoom_level'])) ? 'selected="selected"' : ''; ?>>14</option> 
  49. <option value="15" <? echo ($options['zoom_level'] == "15") ? 'selected="selected"' : ''; ?>>15</option> 
  50. <option value="16" <? echo ($options['zoom_level'] == "16") ? 'selected="selected"' : ''; ?>>16</option> 
  51. <option value="17" <? echo ($options['zoom_level'] == "17") ? 'selected="selected"' : ''; ?>>17</option> 
  52. <option value="18" <? echo ($options['zoom_level'] == "18") ? 'selected="selected"' : ''; ?>>18</option> 
  53. <option value="19" <? echo ($options['zoom_level'] == "29") ? 'selected="selected"' : ''; ?>>19</option> 
  54. <option value="20" <? echo ($options['zoom_level'] == "20") ? 'selected="selected"' : ''; ?>>20</option> 
  55. <option value="21" <? echo ($options['zoom_level'] == "21") ? 'selected="selected"' : ''; ?>>21</option>  
  56. </select> 
  57. </td> 
  58. </tr> 
  59. <tr valign="top"> 
  60. <th scope="row">Language:</th> 
  61. <td> 
  62. <select name="embed_google_map_options[language]"> 
  63. <option value="-">Undefined</option> 
  64. <option value="ar"<? echo ($options['language'] == "ar") ? 'selected="selected"' : ''; ?>>Arabic</option> 
  65. <option value="eu" <? echo ($options['language'] == "eu") ? 'selected="selected"' : ''; ?>>Basque</option> 
  66. <option value="bn" <? echo ($options['language'] == "bn") ? 'selected="selected"' : ''; ?>>Bengali</option> 
  67. <option value="bg" <? echo ($options['language'] == "bg") ? 'selected="selected"' : ''; ?>>Bulgarian</option> 
  68. <option value="ca" <? echo ($options['language'] == "ca") ? 'selected="selected"' : ''; ?>>Catalan</option> 
  69. <option value="zh-CN" <? echo ($options['language'] == "zh-CN") ? 'selected="selected"' : ''; ?>>Chinese (simplified)</option> 
  70. <option value="zh-TW" <? echo ($options['language'] == "zh-TW") ? 'selected="selected"' : ''; ?>>Chinese (traditional)</option> 
  71. <option value="hr" <? echo ($options['language'] == "hr") ? 'selected="selected"' : ''; ?>>Croatian</option> 
  72. <option value="cs" <? echo ($options['language'] == "cs") ? 'selected="selected"' : ''; ?>>Czech</option> 
  73. <option value="da" <? echo ($options['language'] == "da") ? 'selected="selected"' : ''; ?>>Danish</option> 
  74. <option value="nl" <? echo ($options['language'] == "nl") ? 'selected="selected"' : ''; ?>>Dutch</option> 
  75. <option value="en" <? echo ($options['language'] == "en") ? 'selected="selected"' : ''; ?>>English</option> 
  76. <option value="en-AU" <? echo ($options['language'] == "en-AU") ? 'selected="selected"' : ''; ?>>English (Australian)</option> 
  77. <option value="en-GB" <? echo ($options['language'] == "en-GB") ? 'selected="selected"' : ''; ?>>English (Great Britain)</option> 
  78. <option value="fa" <? echo ($options['language'] == "fa") ? 'selected="selected"' : ''; ?>>Farsi</option> 
  79. <option value="fil" <? echo ($options['language'] == "fil") ? 'selected="selected"' : ''; ?>>Filipino</option> 
  80. <option value="fi" <? echo ($options['language'] == "fi") ? 'selected="selected"' : ''; ?>>Finnish</option> 
  81. <option value="fr" <? echo ($options['language'] == "fr") ? 'selected="selected"' : ''; ?>>French</option> 
  82. <option value="gl" <? echo ($options['language'] == "gl") ? 'selected="selected"' : ''; ?>>Galician</option> 
  83. <option value="de" <? echo ($options['language'] == "de") ? 'selected="selected"' : ''; ?>>German</option> 
  84. <option value="el" <? echo ($options['language'] == "el") ? 'selected="selected"' : ''; ?>>Greek</option> 
  85. <option value="gu" <? echo ($options['language'] == "gu") ? 'selected="selected"' : ''; ?>>Gujarati</option> 
  86. <option value="iw" <? echo ($options['language'] == "iw") ? 'selected="selected"' : ''; ?>>Hebrew</option> 
  87. <option value="hi" <? echo ($options['language'] == "hi") ? 'selected="selected"' : ''; ?>>Hindi</option> 
  88. <option value="hu" <? echo ($options['language'] == "hu") ? 'selected="selected"' : ''; ?>>Hungarian</option> 
  89. <option value="id" <? echo ($options['language'] == "id") ? 'selected="selected"' : ''; ?>>Indonesian</option> 
  90. <option value="it" <? echo ($options['language'] == "it") ? 'selected="selected"' : ''; ?>>Italian</option> 
  91. <option value="ja" <? echo ($options['language'] == "ja") ? 'selected="selected"' : ''; ?>>Japanese</option> 
  92. <option value="kn" <? echo ($options['language'] == "kn") ? 'selected="selected"' : ''; ?>>Kannada</option> 
  93. <option value="ko" <? echo ($options['language'] == "ko") ? 'selected="selected"' : ''; ?>>Korean</option> 
  94. <option value="lv" <? echo ($options['language'] == "lv") ? 'selected="selected"' : ''; ?>>Latvian</option> 
  95. <option value="lt" <? echo ($options['language'] == "lt") ? 'selected="selected"' : ''; ?>>Lithuanian</option> 
  96. <option value="ml" <? echo ($options['language'] == "ml") ? 'selected="selected"' : ''; ?>>Malayalam</option> 
  97. <option value="mr" <? echo ($options['language'] == "mr") ? 'selected="selected"' : ''; ?>>Marathi</option> 
  98. <option value="no" <? echo ($options['language'] == "no") ? 'selected="selected"' : ''; ?>>Norwegian</option> 
  99. <option value="nn" <? echo ($options['language'] == "nn") ? 'selected="selected"' : ''; ?>>Norwegian Nynorsk</option> 
  100. <option value="or" <? echo ($options['language'] == "or") ? 'selected="selected"' : ''; ?>>Oriya</option> 
  101. <option value="pl" <? echo ($options['language'] == "pl") ? 'selected="selected"' : ''; ?>>Polish</option> 
  102. <option value="pt" <? echo ($options['language'] == "pt") ? 'selected="selected"' : ''; ?>>Portuguese</option> 
  103. <option value="pt-BR" <? echo ($options['language'] == "pt-BR") ? 'selected="selected"' : ''; ?>>Portuguese (Brazil)</option> 
  104. <option value="pt-PT" <? echo ($options['language'] == "pt-PT") ? 'selected="selected"' : ''; ?>>Portuguese (Portugal)</option> 
  105. <option value="ro" <? echo ($options['language'] == "ro") ? 'selected="selected"' : ''; ?>>Romanian</option> 
  106. <option value="rm" <? echo ($options['language'] == "rm") ? 'selected="selected"' : ''; ?>>Romansch</option> 
  107. <option value="ru" <? echo ($options['language'] == "ru") ? 'selected="selected"' : ''; ?>>Russian</option> 
  108. <option value="sk" <? echo ($options['language'] == "sk") ? 'selected="selected"' : ''; ?>>Slovak</option> 
  109. <option value="sl" <? echo ($options['language'] == "sl") ? 'selected="selected"' : ''; ?>>Slovenian</option> 
  110. <option value="sr" <? echo ($options['language'] == "sr") ? 'selected="selected"' : ''; ?>>Serbian</option> 
  111. <option value="es" <? echo ($options['language'] == "es") ? 'selected="selected"' : ''; ?>>Spanish</option> 
  112. <option value="sv" <? echo ($options['language'] == "sv") ? 'selected="selected"' : ''; ?>>Swedish</option> 
  113. <option value="tl" <? echo ($options['language'] == "tl") ? 'selected="selected"' : ''; ?>>Tagalog</option> 
  114. <option value="ta" <? echo ($options['language'] == "ta") ? 'selected="selected"' : ''; ?>>Tamil</option> 
  115. <option value="te" <? echo ($options['language'] == "te") ? 'selected="selected"' : ''; ?>>Telugu</option> 
  116. <option value="th" <? echo ($options['language'] == "th") ? 'selected="selected"' : ''; ?>>Thai</option> 
  117. <option value="tr" <? echo ($options['language'] == "tr") ? 'selected="selected"' : ''; ?>>Turkish</option> 
  118. <option value="uk" <? echo ($options['language'] == "uk") ? 'selected="selected"' : ''; ?>>Ukrainian</option> 
  119. <option value="vi" <? echo ($options['language'] == "vi") ? 'selected="selected"' : ''; ?>>Vietnamese</option> 
  120. </select> 
  121. </td> 
  122. </tr> 
  123. <tr valign="top"> 
  124. <th scope="row">Add link:</th> 
  125. <td><input name="embed_google_map_options[add_link]" type="checkbox" value="1" <?php checked('1', $options['add_link']); ?> /></td> 
  126. </tr> 
  127. <tr valign="top"> 
  128. <th scope="row">Link label:</th> 
  129. <td><input type="text" name="embed_google_map_options[link_label]" value="<?php echo $options['link_label']; ?>" /></td> 
  130. </tr> 
  131. <tr valign="top"> 
  132. <th scope="row">Show info:</th> 
  133. <td><input name="embed_google_map_options[show_info]" type="checkbox" value="1" <?php checked('1', $options['show_info']); ?> /></td> 
  134. </tr> 
  135. <tr valign="top"> 
  136. <th scope="row">Height:</th> 
  137. <td><input type="text" name="embed_google_map_options[height]" value="<?php echo $options['height']; ?>" /></td> 
  138. </tr> 
  139. <tr valign="top"> 
  140. <th scope="row">Width:</th> 
  141. <td><input type="text" name="embed_google_map_options[width]" value="<?php echo $options['width']; ?>" /></td> 
  142. </tr> 
  143. <tr valign="top"> 
  144. <th scope="row">Border:</th> 
  145. <td> 
  146. <select name="embed_google_map_options[border]"> 
  147. <option value="0" <? echo ($options['border'] == "0") ? 'selected="selected"' : ''; ?>>0</option> 
  148. <option value="1" <? echo ($options['border'] == "1") ? 'selected="selected"' : ''; ?>>1</option> 
  149. <option value="2" <? echo ($options['border'] == "2") ? 'selected="selected"' : ''; ?>>2</option> 
  150. <option value="3" <? echo ($options['border'] == "3") ? 'selected="selected"' : ''; ?>>3</option> 
  151. <option value="4" <? echo ($options['border'] == "4") ? 'selected="selected"' : ''; ?>>4</option> 
  152. <option value="5" <? echo ($options['border'] == "5") ? 'selected="selected"' : ''; ?>>5</option> 
  153. <option value="6" <? echo ($options['border'] == "6") ? 'selected="selected"' : ''; ?>>6</option> 
  154. <option value="7" <? echo ($options['border'] == "7") ? 'selected="selected"' : ''; ?>>7</option> 
  155. <option value="8" <? echo ($options['border'] == "8") ? 'selected="selected"' : ''; ?>>8</option> 
  156. <option value="9" <? echo ($options['border'] == "9") ? 'selected="selected"' : ''; ?>>9</option> 
  157. <option value="10" <? echo ($options['border'] == "10") ? 'selected="selected"' : ''; ?>>10</option> 
  158. </select> 
  159. </td> 
  160. </tr> 
  161. </table> 
  162. <p class="submit"> 
  163. <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> 
  164. </p> 
  165. </form> 
  166.  
  167. <h3>Basic Usage</h3> 
  168. <p>To embed a map in a post or a page use the following code:</p> 
  169. <ul> 
  170. <li>{google_map}address{/google_map}</li> 
  171. </ul> 
  172. <h3>Overriding default settings</h3> 
  173. <p>To override one or more default settings use the following code:</p> 
  174. <ul> 
  175. <li>{google_map}address|zoom:10{/google_map}</li> 
  176. <li>{google_map}address|zoom:10|lang:it{/google_map}</li> 
  177. <li>{google_map}address|width:200|height:200|border:1{/google_map}</li> 
  178. <li>{google_map}address|width:200|height:200|link:yes|link_label:Label{/google_map}</li> 
  179. <li>{google_map}address|link:yes{/google_map}</li> 
  180. <li>{google_map}address|type:satellite{/google_map}</li> 
  181. <li>{google_map}address|show_info:no{/google_map}</li> 
  182. <li><b>*</b>{google_map}latitude, longitude{/google_map}</li> 
  183. </ul> 
  184. <p><b>*</b> latitude, longitude = coordinates in decimal degrees</p> 
  185. <?