{"id":38079,"date":"2015-08-08T12:32:02","date_gmt":"2015-08-08T12:32:02","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/posts-maps\/"},"modified":"2015-08-10T08:21:54","modified_gmt":"2015-08-10T08:21:54","slug":"posts-maps","status":"publish","type":"plugin","link":"https:\/\/ms.wordpress.org\/plugins\/posts-maps\/","author":14542252,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.3","stable_tag":"trunk","tested":"4.2.39","requires":"4.0","requires_php":"","requires_plugins":"","header_name":"Posts Maps","header_author":"Dmitrij Mashkin","header_description":"","assets_banners_color":"","last_updated":"2015-08-10 08:21:54","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"http:\/\/mashkin.pro\/","rating":0,"author_block_rating":0,"active_installs":10,"downloads":1468,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":{"1.0.3":"<p>Bugs of saving coordinates was fixed<\/p>","1.0.2":"<p>Bugs of getting marker of posts by id and center of the map was fixed<\/p>","1.0.1":"<p>Queries optimization for a few markers of the map<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1216372","resolution":"1","location":"assets"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1216372","resolution":"2","location":"assets"},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"1216372","resolution":"3","location":"assets"}},"screenshots":{"1":"Settings","2":"Search place and click right button on map or marker","3":"Add shortcode"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[5326,2909,10345,33032],"plugin_category":[49],"plugin_contributors":[95959],"plugin_business_model":[],"class_list":["post-38079","plugin","type-plugin","status-publish","hentry","plugin_tags-google-map","plugin_tags-map","plugin_tags-post-map","plugin_tags-simple-google-map","plugin_category-maps-and-location","plugin_contributors-dmitrik86","plugin_committers-dmitrik86"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/posts-maps.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/posts-maps\/assets\/screenshot-1.png?rev=1216372","caption":"Settings"},{"src":"https:\/\/ps.w.org\/posts-maps\/assets\/screenshot-2.png?rev=1216372","caption":"Search place and click right button on map or marker"},{"src":"https:\/\/ps.w.org\/posts-maps\/assets\/screenshot-3.png?rev=1216372","caption":"Add shortcode"}],"raw_content":"<!--section=description-->\n<p>Plugin \"Posts maps\" allows to add the google map to your post.<\/p>\n\n<ol>\n<li><p>It display map for one post.<\/p><\/li>\n<li><p>It display map with list of points for a given parameters.<\/p><\/li>\n<li><p>It has a list of default icons.<\/p><\/li>\n<li><p>It allows to use your templates for display map.<\/p><\/li>\n<\/ol>\n\n<p>Simple use<\/p>\n\n<p>Search necessary place via search bar and click right button on the map or marker.<\/p>\n\n<p>Add shortcodes or template tags for action map.<\/p>\n\n<p>Your map is ready.<\/p>\n\n<!--section=installation-->\n<h4>Installation and configuration:<\/h4>\n\n<ol>\n<li><p>Install the plugin.<\/p><\/li>\n<li><p>Choose the settings of the plugin.<\/p><\/li>\n<li><p>Select the post types for which you want to add a map.<\/p><\/li>\n<li><p>Specify the size of the map (if you left field empty, then the height and width of the block will be equal to 100%).<\/p><\/li>\n<\/ol>\n\n<h4>To show the map:<\/h4>\n\n<ol>\n<li><p>Add new\/edit post<\/p><\/li>\n<li><p>Search necessary point on the map and click the right mouse button<\/p><\/li>\n<li><p>Select a marker and save<\/p><\/li>\n<\/ol>\n\n<p>To show the map you need to add shortcode [pm-show-map] to the content<\/p>\n\n<h4>Shortcodes:<\/h4>\n\n<pre><code>[pm-show-map]\n<\/code><\/pre>\n\n<p>It displays a map for the current post.<\/p>\n\n<pre><code>[pm-show-map-by-post-types]\n<\/code><\/pre>\n\n<p>It displays a map with all points of a posts for a given post types.<\/p>\n\n<p>For example, <code>[pm-show-map-by-post-types store market]<\/code>\nIt displays a map for the post types \"store\" and \"market\".<\/p>\n\n<pre><code>[pm-show-map-by-post-id]\n<\/code><\/pre>\n\n<p>It displays a map of a posts for a given post_id<\/p>\n\n<p>For example, \n    [pm-show-map-by-post-id 135 148 1120]\nIt displays a map with points of posts 135, 148 and 1120.<\/p>\n\n<h4>Template tags:<\/h4>\n\n<p>Display map for one post\n    \nIt displays a map for a given post_id<\/p>\n\n<p>Parameters\n    post_ID (integer)(required)<\/p>\n\n<p>Display map for list of post types\n    \nIt displays a map of a posts for a given post types.<\/p>\n\n<p>Parameters\n    post_types(integer\/array)(required)<\/p>\n\n<p>For example, \n    \ndisplays a map for the post types \"store\" and \"market\".<\/p>\n\n<p>Display map for list of post ID\n    \nIt displays a map with points of a posts for a given posts ID\n    posts_ID(integer\/array)(required)<\/p>\n\n<h4>For Developers<\/h4>\n\n<p>If you do not want to use the default plugin templates, tou can to create your template:<\/p>\n\n<p>Create a folder:<\/p>\n\n<pre><code>pmViews\n<\/code><\/pre>\n\n<p>in active theme.<\/p>\n\n<p>Add template:<\/p>\n\n<pre><code>mapBlock.php\n<\/code><\/pre>\n\n<p>to display the map for one post via shortcode [pm-show-map] or template tag showPostMap(post ID)<\/p>\n\n<pre><code>mapBlockMultiple.php\n<\/code><\/pre>\n\n<p>to display the map with a list of points using the shortcode [pm-show-map-by-post-types] or [pm-show-map-by-post-id] or by using the template tag showPostsMapByPostTypes(post types) or showPostsMapByPostId(posts ID)<\/p>\n\n<p>Template variables mapBlock.php:<\/p>\n\n<pre><code>$post - the current post\n\n$lat - latitude for a current post\n\n$lng - longitude for a current post\n\n$postMarker - marker for a current post\n\n$mapMarkerIcons - an associative array with the list of icons\n\n$mapHeight - height of a map\n\n$mapWidth - width of a map\n<\/code><\/pre>\n\n<p>to create a map add this javascript to template:<\/p>\n\n<pre><code>var pmMap = {};\n\npmMap.lat = '&lt;?php echo $lat;?&gt;';\n\npmMap.lng = '&lt;?php echo $lng;?&gt;';\n\npmMap.title = '&lt;?php echo $post-&gt;post_title;?&gt;';\n\npmMap.img = '&lt;?php echo $thumbUrl;?&gt;';\n\npmMap.markerIcon = '&lt;?php echo plugins_url() . '\/posts-maps\/assets\/images\/' . $mapMarkerIcons[$postMarker];?&gt;';\n\ninitialize(pmMap)\n<\/code><\/pre>\n\n<p>Template variables mapBlockMultiple.php:<\/p>\n\n<pre><code>$posts - a list of selected posts\n<\/code><\/pre>\n\n<p>Each item contains:<\/p>\n\n<pre><code>$post_item-&gt;ID - post ID\n\n$post_item-&gt;title - post title\n\n$post_item-&gt;url - post url\n\n$post_item-&gt;thumbUrl - thumbnail url for a post\n\n$post_item-&gt;lat - latitude for a post\n\n$post_item-&gt;lng - Longitude for a post\n\n$post_item-&gt;postMarker - post marker\n\n$post_item-&gt;postMarkerIcon - url icon for a given marker post\n<\/code><\/pre>\n\n<p>to create a map add this javascript to template:<\/p>\n\n<pre><code>var pmMapData = jQuery.parseJSON('&lt;?php echo json_encode($posts);?&gt;');\n\ninitializeMultiple(pmMapData);\n<\/code><\/pre>\n\n<!--section=changelog-->\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Bug of saving coordinates was fixed.<\/li>\n<li>Queries optimization.<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Bugs of getting marker of posts by id and center of the map was fixed.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Queries optimization.<\/li>\n<\/ul>","raw_excerpt":"The plugin allows to add google map to each post quickly and simple.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ms.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/38079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ms.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/ms.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/ms.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=38079"}],"author":[{"embeddable":true,"href":"https:\/\/ms.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/dmitrik86"}],"wp:attachment":[{"href":"https:\/\/ms.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=38079"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/ms.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=38079"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/ms.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=38079"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/ms.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=38079"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/ms.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=38079"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/ms.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=38079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}