{"id":3896,"date":"2014-05-18T03:01:24","date_gmt":"2014-05-18T03:01:24","guid":{"rendered":"http:\/\/szapp.com\/?p=77"},"modified":"2014-05-18T03:01:24","modified_gmt":"2014-05-18T03:01:24","slug":"tweaking-the-osm-plugin","status":"publish","type":"post","link":"https:\/\/wsbj.com\/sorabji\/2014\/05\/18\/tweaking-the-osm-plugin.html","title":{"rendered":"Tweaking the OSM Plugin"},"content":{"rendered":"<p>\t\t\t\tUnless I simply forget to do it every post at Szapp should be followed by a map of a random place on earth. I do this with the <a href=\"http:\/\/wp-osm-plugin.HanBlog.net\" target=\"_top\">OpenStreetMap (OSM) WordPress Plugin<\/a>.<\/p>\n<p>I made a small change to the plugin. By default the OSM maps are output at 600&#215;400. I wanted to make it 800&#215;640, to better fill the space of this template. I may be sorry I did this if ever I switch to a narrower template, though I don&#8217;t foresee that happening.<\/p>\n<p>This theme at present, by the way is &#8220;Divi&#8221;, from <a href=\"http:\/\/ElegantThemes.com\/\" target=\"_top\">ElegantThemes.com<\/a>, where I subscribe to the &#8220;Developer&#8221; account. Most of the 87 themes will never find a use in my travels but many of them should.<\/p>\n<p>I thought I had found the way to change those default sizes in the plugin&#8217;s osm\/osm-options.php file, but I was wrong. The file to be changed is actually osm\/osm-oljs2.php, which contains 2 occurances of width=&#8221;600&#8243; height=&#8221;400&#8243; that I changed to width=&#8221;800&#8243; height=&#8221;640&#8243;.<\/p>\n<p>If I make any other change it would be to output the shortcode into a &lt;textarea&gt; or &lt;input type=&#8221;text&#8221;&gt; window for easier copying and pasting. Either that or figure out how to automatically copy the shortcode to clipboard when the map is clicked.<\/p>\n<div class='et-box et-warning'>\n\t\t\t\t\t<div class='et-box-content'>UPDATE: May 19, 2014. As I should have guessed, updating the plugin to its most recent version overwrites this tweak. Maybe it&#8217;s better left as-is.<\/div><\/div>\n<p><span style=\"color: #444444\"><style type=\"text\/css\">#map_1 {clear: both; padding: 0px; margin: 0px; border: 0px; width: 100%; height: 100%; margin-top:0px; margin-right:0px;margin-left:0px; margin-bottom:0px; left: 0px; border-radius:0px;\nbox-shadow: none;}#map_1 img{clear: both; padding: 0px; margin: 0px; border: 0px; width: 100%; height: 100%; position: absolute; margin-top:0px; margin-right:0px;margin-left:0px; margin-bottom:0px; border-radius:0px;\nbox-shadow: none;}<\/style><div id=\"map_1\" class=\"OSM_Map\" style=\"width:800px; height:640px; overflow:hidden;padding:0px;border:none;\"><script data-jetpack-boost=\"ignore\" type=\"text\/javascript\">\/* <![CDATA[ *\/(function($) { OpenLayers.ImgPath = \"https:\/\/wsbj.com\/sorabji\/wp-content\/plugins\/osm\/themes\/ol\/\"; map_1 = new OpenLayers.Map (\"map_1\", {            controls:[              new OpenLayers.Control.Navigation(),              new OpenLayers.Control.PanZoom(),              new OpenLayers.Control.Attribution()              ],          maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),          maxResolution: 156543.0399,          numZoomLevels: 19,          units: \"m\",          projection: new OpenLayers.Projection(\"EPSG:900913\"),          displayProjection: new OpenLayers.Projection(\"EPSG:4326\")      } );var layerMapnik = new OpenLayers.Layer.OSM.Mapnik(\"Mapnik\");var layerCycle  = new OpenLayers.Layer.OSM.CycleMap(\"CycleMap\");map_1.addLayers([layerMapnik, layerCycle]);map_1.addControl(new OpenLayers.Control.LayerSwitcher());var lonLat = new OpenLayers.LonLat(-7.286,54.994).transform(map_1.displayProjection, map_1.projection);map_1.setCenter (lonLat,15);var lonLat = new OpenLayers.LonLat(-7.286,54.994).transform(map_1.displayProjection, map_1.projection);map_1.setCenter (lonLat,15);})(jQuery)\/* ]]> *\/ <\/script><\/div><\/span>\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unless I simply forget to do it every post at Szapp should be followed by a map of a random place on earth. I do this with the OpenStreetMap (OSM) WordPress Plugin. I made a small change to the plugin. By default the OSM maps are output at 600&#215;400. I wanted to make it 800&#215;640, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[32],"tags":[],"class_list":["post-3896","post","type-post","status-publish","format-standard","hentry","category-unrepentant","et-doesnt-have-format-content","et_post_format-et-post-format-standard"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paumAn-10Q","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/wsbj.com\/sorabji\/wp-json\/wp\/v2\/posts\/3896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wsbj.com\/sorabji\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wsbj.com\/sorabji\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wsbj.com\/sorabji\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wsbj.com\/sorabji\/wp-json\/wp\/v2\/comments?post=3896"}],"version-history":[{"count":0,"href":"https:\/\/wsbj.com\/sorabji\/wp-json\/wp\/v2\/posts\/3896\/revisions"}],"wp:attachment":[{"href":"https:\/\/wsbj.com\/sorabji\/wp-json\/wp\/v2\/media?parent=3896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wsbj.com\/sorabji\/wp-json\/wp\/v2\/categories?post=3896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wsbj.com\/sorabji\/wp-json\/wp\/v2\/tags?post=3896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}