Your Guide To Online Business
There are two ways to insert markers into a map:
To add markers to a map you just add the attribute markers, in the following format:
data fields::marker 1 data::marker 2 data::marker 3 data::…::marker x data::html pattern
The different data fields and marker data corresponding each field are separated by ||
The html pattern allows you to format the output of the data in the way you want. Just add the different fields above surrounded by || in your HTML and the corresponding data for each marker will be inserted there:
field1||field2||field3::field1data1||field2data1||field3data1::field1data2||field2data2||field3data2::<a href=’||field1||’>||field2||</a><br />||field3||
For example, using the code below:
[wp-google-maps lat=”62.30879369102805″ lon=”22.412109375″ zoom=”4″ markers=”lat||lng||name||url||image||city::59.314776003521466||18.06274652481079||Miss Inga||http://ezbizniz.com/||http://ezbizniz.com/wp-content/uploads/2009/02/miss-inga.jpg||Stockholm::64.87845047505995||20.80837368965149||Agent Smith||http://www.google.com/||http://ezbizniz.com/wp-content/uploads/2009/02/agent-smith.jpg||Kusmark::<a href=’||url||’><img src=’||image||’ align=’left’>||name||</a><br />||city||<br />”]
you’ll get:
It’s possible to use a marker XML feed to insert markers into a map. When you download WP Google Maps you find the file wp-google-maps-markers.xml.php where you can see an example on how to use it. The fie wp-google-maps-markers.xml.php is for installations of WordPress MU and BuddyPress so it might not work for standard WordPress installations.
Below is an example on how to use the marker XML feed:
[wp-google-maps lat=”62.30879369102805″ lon=”22.412109375″ zoom=”4″ markerxmlfeed=”http://www.ezbizniz.com/wp-content/plugins/wp-google-maps/wp-google-maps-markers.xml.php” markerxmlfeedfields=”name||url||img||city||lat||lng” markerxmlfeedhtmlpattern=”<a href=’||url||’&tg;<img src=” align=’left’ />||name||</a><br />||city||”]
You can use the marker XML feed functionality in your template files by using the following function:
wp_google_maps(“lat=62.30879369102805&lon=22.412109375&zoom=4&width=460&height=400&markerxmlfeed=” . get_bloginfo(‘url’) . “/wp-content/mu-plugins/wp-google-maps/wp-google-maps-markers.xml.php&markerxmlfeedfields=name||url||city&markerxmlfeedhtmlpattern=<a href=’||url||’>||name||</a><br />||city||”);
In some cases the XML feed fields and HTML pattern get too long for Internet Explorer. You can then add options to your theme using add_option(‘fields_option_name’) and add_option(‘html_pattern_option_name’) where you store your XML feed fields and HTML pattern.
If you enter markerxmlfeedfields_get_option_fields_option_name and markerxmlfeedhtmlpattern_get_option_html_pattern_option_name instead of the feed fields and HTML pattern like below, the data is taken from your database:
wp_google_maps(“lat=62.30879369102805&lon=22.412109375&zoom=4&width=460&height=400&markerxmlfeed=” . get_bloginfo(‘url’) . “/wp-content/mu-plugins/wp-google-maps/wp-google-maps-markers.xml.php&markerxmlfeedfields=markerxmlfeedfields_get_option_communix_google_maps_markerxmlfeedfields&markerxmlfeedhtmlpattern=markerxmlfeedhtmlpattern_get_option_communix_google_maps_markerxmlfeedhtmlpattern”);
Recent Comments