Zh GoogleMap LoadPlacemarks

From Documentation
Jump to navigation Jump to search

Prepare and Load Placemark Data

For example, you have a lot of placemarks, and want to load it into Zh GoogleMap extension.

In this case we will use phpMyAdmin (or others interface to connect to your database for loading data)

Lets prepare data for loading.

You can use any text editor, or prepare it in MS Excel (like csv format).

For loading data today you have to load this minimum data

  • title - Placemark title
  • latitude - optional
  • longitude - optional
  • addresstext - optional - Address, defined by text
  • mapid - Map ID
  • icontype

And special values for placemark attributes

  • published
  • baloon - field Marker, values
    • 0 - No (default)
    • 1 - Drop
    • 2 - Bounce
    • 3 - Simple
  • markercontent - field InfoWin Content, values
    • 0 - Title and Description (default)
    • 1 - Title
    • 2 - Description
    • 100 - None

If you wish

  • description - Placemark Description
  • descriptionhtml - Addition HTML text


If you have lat/lng pair - you specify it, if you have only text address - then you should enter it in addresstext field

Lets create sql clause to load three placemark

First of all - you have to create map, and in map list get its ID.

I create map, and map ID is 13

After that you have access into MySQL and get table name for placemarks.

Scroll down your table list to find table like prefixzhgooglemaps_markers, in my case it name jos_j16zhgooglemaps_markers

And now create sql by text editor

INSERT INTO `jos_j16zhgooglemaps_markers`(`title`, `latitude`, `longitude`, `addresstext`, `published`, `baloon`, `icontype`, `mapid`) 
VALUES 
('Placemark #1', 59.91854831914932, 30.39719313507078, '', 1, 1, 'default#', 13),
('Placemark #2', 59.9185483191492, 30.3971931350778, '', 1, 1, 'default#', 13),
('Placemark #3', 59.91854831913492, 30.39719313250778, '', 1, 1, 'default#', 13)
;

In this code you can see, that I load placemarks by its coordinates (lat/lng)

Set flag Published to Yes (1) and Marker to Drop, and Icon Type to default#

As you can see, you can easy create data block in any editor, and it is very simple.

If you wish to load addition data into the other table fields, you should add it name into insert into column clause and values into values section in your order.


After that copy your code, go to phpMyAdmin, select your database, click SQL tab, paste your code and press Go

And wait for loading end.

That's All.