Title: Posts Maps
Author: dmitrik86
Published: <strong>8 ສິງຫາ 2015</strong>
Last modified: 10 ສິງຫາ 2015

---

ຄົ້ນຫາປລັກອິນ

ປລັກອິນນີ້ **ຍັງບໍ່ທັນໄດ້ຮັບການທົດສອບກັບ WordPress 3 ເວີຊັນຫຼັກຫຼ້າສຸດ**. ມັນອາດຈະ
ບໍ່ໄດ້ຮັບການເບິ່ງແຍງ ຫຼື ສະໜັບສະໜູນອີກຕໍ່ໄປ ແລະ ອາດມີບັນຫາການເຮັດວຽກຮ່ວມກັນເມື່ອ
ໃຊ້ກັບ WordPress ເວີຊັນທີ່ໃໝ່ກວ່າ.

![](https://s.w.org/plugins/geopattern-icon/posts-maps.svg)

# Posts Maps

 ໂດຍ [dmitrik86](https://profiles.wordpress.org/dmitrik86/)

[ດາວໂຫຼດ](https://downloads.wordpress.org/plugin/posts-maps.zip)

 * [ລາຍລອຽດ](https://lo.wordpress.org/plugins/posts-maps/#description)
 * [ການຣີວິວ](https://lo.wordpress.org/plugins/posts-maps/#reviews)
 *  [ການຕິດຕັ້ງ](https://lo.wordpress.org/plugins/posts-maps/#installation)
 * [ການພັດທະນາ](https://lo.wordpress.org/plugins/posts-maps/#developers)

 [ການຊ່ວຍເຫຼືອ](https://wordpress.org/support/plugin/posts-maps/)

## ຄຳອະທິບາຍ

Plugin “Posts maps” allows to add the google map to your post.

 1. It display map for one post.
 2. It display map with list of points for a given parameters.
 3. It has a list of default icons.
 4. It allows to use your templates for display map.

Simple use

Search necessary place via search bar and click right button on the map or marker.

Add shortcodes or template tags for action map.

Your map is ready.

## ພາບໜ້າຈໍ

[⌊Settings⌉⌊Settings⌉[

Settings

[⌊Search place and click right button on map or marker⌉⌊Search place and click right
button on map or marker⌉[

Search place and click right button on map or marker

[⌊Add shortcode⌉⌊Add shortcode⌉[

Add shortcode

## ການຕິດຕັ້ງ

#### Installation and configuration:

 1. Install the plugin.
 2. Choose the settings of the plugin.
 3. Select the post types for which you want to add a map.
 4. Specify the size of the map (if you left field empty, then the height and width
    of the block will be equal to 100%).

#### To show the map:

 1. Add new/edit post
 2. Search necessary point on the map and click the right mouse button
 3. Select a marker and save

To show the map you need to add shortcode [pm-show-map] to the content

#### Shortcodes:

    ```
    [pm-show-map]
    ```

It displays a map for the current post.

    ```
    [pm-show-map-by-post-types]
    ```

It displays a map with all points of a posts for a given post types.

For example, `[pm-show-map-by-post-types store market]` It displays a map for the
post types “store” and “market”.

    ```
    [pm-show-map-by-post-id]
    ```

It displays a map of a posts for a given post_id

For example, [pm-show-map-by-post-id 135 148 1120] It displays a map with points
of posts 135, 148 and 1120.

#### Template tags:

Display map for one post It displays a map for a given post_id

Parameters post_ID (integer)(required)

Display map for list of post types It displays a map of a posts for a given post
types.

Parameters post_types(integer/array)(required)

For example, displays a map for the post types “store” and “market”.

Display map for list of post ID It displays a map with points of a posts for a given
posts ID posts_ID(integer/array)(required)

#### For Developers

If you do not want to use the default plugin templates, tou can to create your template:

Create a folder:

    ```
    pmViews
    ```

in active theme.

Add template:

    ```
    mapBlock.php
    ```

to display the map for one post via shortcode [pm-show-map] or template tag showPostMap(
post ID)

    ```
    mapBlockMultiple.php
    ```

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)

Template variables mapBlock.php:

    ```
    $post - the current post

    $lat - latitude for a current post

    $lng - longitude for a current post

    $postMarker - marker for a current post

    $mapMarkerIcons - an associative array with the list of icons

    $mapHeight - height of a map

    $mapWidth - width of a map
    ```

to create a map add this javascript to template:

    ```
    var pmMap = {};

    pmMap.lat = '<?php echo $lat;?>';

    pmMap.lng = '<?php echo $lng;?>';

    pmMap.title = '<?php echo $post->post_title;?>';

    pmMap.img = '<?php echo $thumbUrl;?>';

    pmMap.markerIcon = '<?php echo plugins_url() . '/posts-maps/assets/images/' . $mapMarkerIcons[$postMarker];?>';

    initialize(pmMap)
    ```

Template variables mapBlockMultiple.php:

    ```
    $posts - a list of selected posts
    ```

Each item contains:

    ```
    $post_item->ID - post ID

    $post_item->title - post title

    $post_item->url - post url

    $post_item->thumbUrl - thumbnail url for a post

    $post_item->lat - latitude for a post

    $post_item->lng - Longitude for a post

    $post_item->postMarker - post marker

    $post_item->postMarkerIcon - url icon for a given marker post
    ```

to create a map add this javascript to template:

    ```
    var pmMapData = jQuery.parseJSON('<?php echo json_encode($posts);?>');

    initializeMultiple(pmMapData);
    ```

## ການຣີວິວ

ບໍ່ມີການຣີວິວສຳລັບປລັກອິນນີ້.

## ຜູ້ຮ່ວມພັດທະນາ ແລະ ຜູ້ພັດທະນາ

“Posts Maps” ແມ່ນຊອຟແວໂອເພັນຊອດ (Open Source). ບຸກຄົນຕໍ່ໄປນີ້ໄດ້ມີສ່ວນຮ່ວມໃນການພັດ
ທະນາປລັກອິນນີ້.

ຜູ້ຮ່ວມພັດທະນາ

 *   [ dmitrik86 ](https://profiles.wordpress.org/dmitrik86/)

[ແປ “Posts Maps” ເປັນພາສາຂອງເຈົ້າ.](https://translate.wordpress.org/projects/wp-plugins/posts-maps)

### ສົນໃຈຮ່ວມພັດທະນາບໍ່?

[ເບິ່ງລະຫັດ](https://plugins.trac.wordpress.org/browser/posts-maps/), ກວດເບິ່ງ [ຄັງເກັບ SVN](https://plugins.svn.wordpress.org/posts-maps/),
ຫຼື ຕິດຕາມ [ບັນທຶກການພັດທະນາ](https://plugins.trac.wordpress.org/log/posts-maps/)
ຜ່ານ [RSS](https://plugins.trac.wordpress.org/log/posts-maps/?limit=100&mode=stop_on_copy&format=rss).

## ບັນທຶກການປ່ຽນແປງ

#### 1.0.3

 * Bug of saving coordinates was fixed.
 * Queries optimization.

#### 1.0.2

 * Bugs of getting marker of posts by id and center of the map was fixed.

#### 1.0.1

 * Queries optimization.

## ຂໍ້ມູນກຳກັບ (Meta)

 *  ເວີຊັນ **1.0.3**
 *  ອັບເດດຫຼ້າສຸດເມື່ອ **11 ປີ ທີ່ຜ່ານມາ** ທີ່ຜ່ານມາ
 *  ການຕິດຕັ້ງທີ່ໃຊ້ງານຢູ່ **10+**
 *  ເວີຊັນ WordPress ** 4.0 ຫຼື ສູງກວ່າ **
 *  ທົດສອບເຖິງເວີຊັນ **4.2.39**
 *  ພາສາ
 * [English (US)](https://wordpress.org/plugins/posts-maps/)
 * ແທັກ
 * [google map](https://lo.wordpress.org/plugins/tags/google-map/)[map](https://lo.wordpress.org/plugins/tags/map/)
   [simple google map](https://lo.wordpress.org/plugins/tags/simple-google-map/)
 *  [ມຸມມອງຂັ້ນສູງ](https://lo.wordpress.org/plugins/posts-maps/advanced/)

## ການໃຫ້ຄະແນນ

ຍັງບໍ່ມີການສົ່ງຄຳວິຈານເທື່ອ.

[Your review](https://wordpress.org/support/plugin/posts-maps/reviews/#new-post)

[ເບິ່ງ ຄຳຄິດເຫັນ ທັງໝົດ](https://wordpress.org/support/plugin/posts-maps/reviews/)

## ຜູ້ຮ່ວມພັດທະນາ

 *   [ dmitrik86 ](https://profiles.wordpress.org/dmitrik86/)

## ການຊ່ວຍເຫຼືອ

ມີຄຳຖາມ ຫຼື ຕ້ອງການຄວາມຊ່ວຍເຫຼືອບໍ່?

 [ເບິ່ງຟໍຣັມການຊ່ວຍເຫຼືອ](https://wordpress.org/support/plugin/posts-maps/)