Within the last weeks there have been several requests regarding the new WP OSM Plugin shortcode osm_map_v3 and the differences to osm_map. So it’s time for a more detailled answere which needs some background information. All mapping plugings are ususally structured like this:
- there are map data wich should be displayed (OpenStreetMap, Bin, GoogleMaps, …)
- there are software components to display map data (OpenLayers, Leaflet, GoogleAPI, …)
- there is additional functionality added by the mapping plugin (show geotagged posts, shortcode generator, …)
The responsibility for 1.) is handed over to blog admin / author, the maps differ a lot in the license and that’s way many people choose OpenStreetMap for commercial and non commercial sites.
The point 2.) is quite important for the compatibility of your map on different browsers / devices. A lot of mapping plugins integrate software components which are five years old or even older … especially in the last years this part changed a lot because of mobile devices. WP OSM Plugin V3.5.1 with argument osm_map_v3 integrates OpenLayers 3.10.1 which was released in October 2015.
The point 3.) is mainly the added value by the plugin development team.
WP OSM Plugin provides two shortcodes to integrate maps, it’s like a “two in one plugin”. The osm_map shortcode ist based on OpenLayers 2 technology (point 2.) which is not state of the art anymore but still works. The new osm_map_v3 uses a mapping software which is the state of the art OpenLayers 3 and was released 1 month ago.
osm_map_v3 is a new and seperate development and because of limitted resource, the maintenance os WP OSM Plugin is limitted to osm_map_v3. Also new features, like fullscreen map button <=> is only implemented in osm_map_v3!
osm_map_v3 focuses on mobile devices, performance and simplicity
The arguments to be used with osm_map_v3 changed compared to osm_map. Mostly the shortcode is autogenerated with the WP OSM Plugin shortcode generator when you edit the post, but if you want just manually change it, you might want to know the relation within the table at the end of the article.
A map with all geotagged posts has got this osm_map_v3 shortcode:
[*osm_map_v3 map_center="52.795,23.51" zoom="3" width="75%" height="300" tagged_type="post" marker_name="wpttemp-yellow.png" control="fullscreen" map_border="thin solid grey"]
Improvement needs your feedback
You should update your osm_map shortcode to osm_map_v3 shortcode to make sure your readers see want you want them to see – on different devices with different features and high performance.
For further improvements we want to know which shortcode you use – please leave a comment to this article with your shortcode.
WP OSM Plugin shortcode table:
|lat||map_center||lat and lon are compined in one argument|
|kml_file||file_list||filetype is recognized by osm plugin.|
|control||control||not fully supported|
|kml_colour||file_color_list||color is automatically related to gpx or kml files|
|import||tagged_type||import and post_type is combined to one|
|marker_height||***||not supported yet|
|marker_width||***||not supported yet|
|marker_focus||***||not supported yet|
|marker_routing||***||not supported yet|
|import_osm_cat_excl_name||***||not supported yet|
|import_osm_cat_incl_name||***||not supported yet|
|import_osm_line_width||***||not supported yet|
|import_osm_line_color||***||not supported yet|
|import_osm_line_opacity||***||not supported yet|
|theme||—||not supported anymore|
|marker_file||—||not supported anymore|