Zh GoogleMap Plugin

From Documentation
Jump to: navigation, search

Purpose

Plugin for component is created for inserting maps into articles.

All maps (not in plugin section), that you see in demo site was displayed as a component call, but All Features are supported in call as plugin.

The only two things are not supported in plugin:

  • Placemark Management by Group List
  • Creating user placemarks - ie allow entering placemarks for registered user from Front End

But you can call plugin as a lightbox - in this case you show map as a component

Moreover, since it is a plugin for the content (type is content), then you can insert code to call in the Custom HTML module and display the map as a module.

It is recommended to put width=0 (which corresponds to the width: 100%), in order to map automatically fills the width of the module, and is resized (eg, a variable template size) and did not occur map oversizing.

Installation

Install the plugin in Extension Manager.

Make it active.


It is plugin for component, therefore component have to be installed

Plugin supports autoupdate feature

Using

Show Map

To show the map in an article, insert the following code

{zhgooglemap:MMM;Zoom;MapType;Width;Height}

where

  • MMM - (required) map ID. It is displayed in a map list.
  • Zoom - new zoom of map, valid values
    • values from 0 to 21 to override zoom
    • do not change - do not change map zoom
  • MapType - new map type
    • ROADMAP
    • SATELLITE
    • HYBRID
    • TERRAIN
    • OSM
    • NZTOPOMAPS
    • do not change - do not change map type
  • Width - new map width
    • width value in pixels
    • do not change - do not change map width
  • Height - new map height
    • height value in pixels
    • do not change - do not change map height

Show Map by Placemark

Also, you can show the map with only one specific placemark. To do this, insert the following call

{zhgooglemap-marker:NNN;Center;Zoom;MapType;Width;Height;Action}

where

  • NNN - (required) placemark ID
  • Center - map center or placemark is new center of map, valid values:
    • map
    • placemark
  • Zoom - new zoom of map, valid values
    • values from 0 to 21 to override zoom
    • do not change - do not change map zoom
  • MapType - new map type
    • ROADMAP
    • SATELLITE
    • HYBRID
    • TERRAIN
    • OSM
    • NZTOPOMAPS
    • do not change - do not change map type
  • Width - new map width
    • width value in pixels
    • do not change - do not change map width
  • Height - new map height
    • height value in pixels
    • do not change - do not change map height
  • Action - execute action when loaded map (you can specify a few, separated by comma)
    • do not change - do not execute anything
    • click - execute click action on placemark. In this case you have to set Center=placemark
    • bounce - change placemark animation to BOUNCE
    • icon_name_without_extension - change placemark icon




Example 1:
{zhgooglemap-marker:5;placemark;10}


Example 2:
{zhgooglemap-marker:1;map;do not change}


Example 3:
{zhgooglemap-marker:4}
In this case

  • Center by default set to map
  • Zoom by default is set to do not change



Example 4:
{zhgooglemap-marker:1;;15}
In this case

  • Center by default set to map
  • Zoom is set 15


Example 5:
{zhgooglemap-marker:1;placemark;;;;;bounce,hello}
In this case

  • Center set to placemark
  • Animation set to BOUNCE, and placemark icon changed to hello.png - check, that exists in icon assets folder

Show map by Placemark List

To show the map with placemarks from different maps (and this placemarks is specified by list) by the following call

{zhgooglemap-markerlist:PlacemarkList;MMM;Zoom;MapType;Width;Height}

where

  • PlacemarkList - (required) list of placemarks IDs, separated by comma
  • MMM - (required) map ID
  • Zoom - new zoom of map, valid values
    • values from 0 to 21 to override zoom
    • do not change - do not change map zoom
  • MapType - new map type
    • ROADMAP
    • SATELLITE
    • HYBRID
    • TERRAIN
    • OSM
    • NZTOPOMAPS
    • do not change - do not change map type
  • Width - new map width
    • width value in pixels
    • do not change - do not change map width
  • Height - new map height
    • height value in pixels
    • do not change - do not change map height


Example 1:

{zhgooglemap-markerlist:1,2,5;10}
In this case you'll see placemark with ID=1, with ID=2 and with ID=5 on map with ID=10

Show map by Placemark Group

To show the map with placemarks from different maps (and this placemarks have a definite group) by the following call

{zhgooglemap-group:NNN;MMM;Zoom;MapType;Width;Height;Center;Action}

where

  • NNN - (required) placemark group list (list of groups ID), separated by comma
  • MMM - (required) map ID
  • Zoom - new zoom of map, valid values
    • values from 0 to 21 to override zoom
    • do not change - do not change map zoom
  • MapType - new map type
    • ROADMAP
    • SATELLITE
    • HYBRID
    • TERRAIN
    • OSM
    • NZTOPOMAPS
    • do not change - do not change map type
  • Width - new map width
    • width value in pixels
    • do not change - do not change map width
  • Height - new map height
    • height value in pixels
    • do not change - do not change map height
  • Center - set center of map
    • placemark ID for center map by it. Placemark have to be defined by latitude and longitude
    • do not change - do not change map center
  • Action - execute action when loaded map (you can specify a few, separated by comma)
    • do not change - do not execute anything
    • click - execute click action on center placemark.
    • bounce - change placemark animation to BOUNCE
    • icon_name_without_extension - change placemark icon

Show Map by Category

You can show the map with placemarks from different maps by placemark category. To do this, insert the following call

{zhgooglemap-category:NNN;MMM;Zoom;MapType;Width;Height;Center;Action}

where

  • NNN - (required) placemark category list (list of categories ID), separated by comma
  • MMM - (required) map ID
  • Zoom - new zoom of map, valid values
    • values from 0 to 21 to override zoom
    • do not change - do not change map zoom
  • MapType - new map type
    • ROADMAP
    • SATELLITE
    • HYBRID
    • TERRAIN
    • OSM
    • NZTOPOMAPS
    • do not change - do not change map type
  • Width - new map width
    • width value in pixels
    • do not change - do not change map width
  • Height - new map height
    • height value in pixels
    • do not change - do not change map height
  • Center - set center of map
    • placemark ID for center map by it. Placemark have to be defined by latitude and longitude
    • do not change - do not change map center
  • Action - execute action when loaded map (you can specify a few, separated by comma)
    • do not change - do not execute anything
    • click - execute click action on center placemark.
    • bounce - change placemark animation to BOUNCE
    • icon_name_without_extension - change placemark icon

When you show map by category, all objects on map (placemarks, routes, paths) is filtered by this category.

Show Map in Lightbox

To show the map in lightbox, insert the following code

{zhgooglemap-lightbox:MMM;Title;Width;Height;Image;PlacemarkList;Zoom;Center;Action}

where

  • MMM – (required) map id
  • Title – title on link
  • Width – width of lightbox-window
  • Height – height of lightbox-window.
  • Image - filename of image, which can be displayed.

Images you have to store in component asset folder, and specify only filename and extension

administrator/components/com_zhgooglemap/assets/lightbox/
  • PlacemarkList - list of placemarks IDs, separated by comma
  • Zoom - new zoom of map, valid values
    • values from 0 to 21 to override zoom
  • Center - set center of map
    • placemark ID for center map by it. Placemark have to be defined by latitude and longitude and exists on map
    • do not change - do not change map center
  • Action - execute action when loaded map (you can specify a few, separated by comma)
    • do not change - do not execute anything
    • click - execute click action on center placemark.
    • bounce - change placemark animation to BOUNCE
    • icon_name_without_extension - change placemark icon


It is restriction to use some symbols.
You must not use in Title this symbols
< > / \

The icon_name_without_extension it is filename, but you must not use this symbols
#
The predefined icons contains this symbols (default#... icons), and in this case you have to clone it with simple name without special charters. In future 'big' release (from version 3 to 4 this predefined icons will be renamed!!!)


Map is displaying as component, not as plugin. I.e. the plugin calls the component. There is one specialty. CSS from template not loaded.



Example 1:

{zhgooglemap-lightbox:2;;800;500;ZhukLogo.png}

  • In this case link title is not displayed, just only image.


If you don't set title and image - there is default text is displayed as title.


GeoTags - mark your articles by tags and show map for an article

You can mark your articles by tags, and define map for an article. To do this, insert the following call

{zhgooglemap-geotag:Call_Parameters_See_Below}

Where Call_Parameters_See_Below - parameters, which you pass to plugin call.

The format for parameters is:

parameter_name=parameter_value

Plugin supported next parameters:

  • latitude - placemark latitude
  • lat - placemark latitude (synonym)
  • longitude - placemark longitude
  • lng - placemark longitude (synonym)
  • lon - placemark longitude (synonym)
  • ll - placemark latitude and longitude, separated by comma
  • zoom - map zoom
  • z - map zoom (synonym)
  • tags - geotags, separated by comma
  • tag - geotags (synonym)
  • maptype - map type for displaying (open properly map), you can set next types of map
    • google - default value
    • osm
    • yahoo
    • nokia
    • bing
    • yandex


Latitude and longitude parameters (or its pair parameter) - it is required

The synonym for parameters ll and z is done for more flexible use - if you open Google's Map, and press Link button - you'll see the code, which you can include to show for link to your map in any documents. And it is done for you copy this values (ll and z) from this prepared string to plugin call.


There are a few examples

Example 1:

{zhgooglemap-geotag:latitude=30.23;longitude=50.11;tags=Tag1,Tag2}

This call mark an article by two tags - Tag1 and Tag2.


Example 2:

{zhgooglemap-geotag:ll=30.23,50.11;tags=Tag1,Tag2}

It is the same as Example 1, but pass coordinates by its pair.


You can combine parameters, and pass it in any sequence


Example 3:

{zhgooglemap-geotag:zoom=14;ll=30.23,50.11;tags=Tag1,Tag2}


Example 4:

{zhgooglemap-geotag:zoom=14;ll=30.23,50.11;tags=Tag1,Tag2;maptype=nokia}

Restrictions

Plugin does not work in contacts, because of a contact has type, that differs from "content"
But you have opportunity write article like contact page, as you like, and include map
Or you can use module in this case

It is plugin for component, therefore component have to be installed

See also

Icon-attachment.pngDetail component description

Icon-attachment.pngModule for component



Language: English  • русский