Zh GoogleMap ExternalPlacemarkListGroupList

From Documentation
Jump to: navigation, search

Set external position for placemark list and group list

As you know, you can display placemark lists on different positions - before map, after map, on map.

If you display before or after map, you have divs, which position you can also control by styles.

Today I want to show how use External value for positions.

For example, you want to change built-in Panel feature position, lets do tabs below the map.

Before my changes my map is like

ExternalPlacemarkGroupList Before.png

In my case there are two features enabled - manage placemarks by group list and placemark list.

Placemark list synchronized with active groups.

Moreover, enabled autocomplete feature for placemark list and for group list.

First of all lets change its position to External

Go to map details, open tab Placemark list. Change position.

ExternalPlacemarkGroupList ChangePLpos.png

Then open Placemark Groups and do the same (change position) for group list.

ExternalPlacemarkGroupList ChangeGLpos.png

If you save changes and refresh site page with map, you'll get alerts - unable to find div section for group list and ul tag for placemark list.

If you display map by component call (ie menu item Map) then IDs for

  • group list: div tag with ID="GMapsGroupDIV"
  • placemark list: ul tag with ID="GMapsMarkerUL"

For external position you have to manual create this div and/or ul tags.

As for autocomplete field for placemark list. Due to this field is not connected to placemark list ul tag, today if you enable this feature you have to create this field too. Probably, in future for external position case I will support automatic field creation.

For example, you can create Custom HTML module for it and just enter simple HTML tags.

In my case I will use map footer. There is a field in map details to write just below the map, go to Footer tab.

Now I want to use JQuery IU to create tabs.

ExternalPlacemarkGroupList Footer.png

My result code is

  <script type="text/javascript" >
  jQuery( function() {
    jQuery( "#GMapsPanelExternal" ).tabs();
  } );
<div id="GMapsPanelExternal">
<li><a href="#GMapsPanelExternal-tabs-1">Категории</a></li>
<li><a href="#GMapsPanelExternal-tabs-2">Компаниjа</a></li>
<div id="GMapsPanelExternal-tabs-1">
    <div id="GMapsGroupDIV">&nbsp;</div>
<div id="GMapsPanelExternal-tabs-2">
    <div id="GMapsMarkerListExternal">
        <div id="GMapsMarkerListSearchExternal">
        <input id="GMapsMarkerListSearchAutocomplete" placeholder="Компаниjа" >
        <div id="GMapsMarkerListMainExternal">
        <ul id="GMapsMarkerUL">&nbsp;</ul>

And after this steps you can see new map

ExternalPlacemarkGroupList After.png

As you can see it is not hard to do, just a few tags. This example is more complicated, because I want to display it on tabs. In your case it can be just div tag for group list and div+ul tag for placemark list.

In this example I added ID for all my divs for future (if you want to modify styles for it)

ExternalPlacemarkGroupList Tags.png