Support Forum

  • Page:
  • 1

Add one more marker

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

I would like to add one more marker to the maps. I tried to do it based on a previous post about this but that was 12 months ago and it seems you have changed the module since then so the code doesn't match up. Can someone please give me the xml and php additions for this? Thank you!
  • cherubini's Avatar
  • cherubini
  • 3 Month Basic
  • 7 posts
  • Karma: 0
The administrator has disabled public write access.
Hi there,

Its been a while since Ive looked at that module.

You need to basically duplicate the parameters int he xml and php files.

eg in the xml add another grow like this:
	<param name="@spacer" type="spacer" default="" label="" description="" />
		<param name="pub4" type="list" default="no" label="Publish this marker" description="Line break after name field">
            <option value="1">Yes</option>
            <option value="0">No</option>
		</param>
        <param name="lat4" type="text" default="" label="Marker 3 Latitude" description="Marker 3 Latitude" />
        <param name="long4" type="text" default="" label="Marker 3 Longitude" description="Marker 3 Longitude" />
        <param name="title4" type="text" default="" label="Title for third marker" description="Enter plain text or html here for a title on the marker." />
        <param name="html4" type="textarea" cols="30" rows="5" default="" label="Description for third marker" description="Enter plain text or html here for a description on the marker." />

then in the php file add this:
$lat4 = (float)$params->get( 'lat4', '4' );
$long4 = (float)$params->get( 'long4', '4' );
$html4 = $params->get( 'html4', '' );
$pub4 = (int)$params->get( 'pub4', '0' );


then change the following code:
$lats = array($lat1,$lat2,$lat3);
		$longs = array($long1,$long2,$long3);
		$pubs = array($pub1,$pub2,$pub3);
		$htmls = array(preg_replace("/\r?\n/", "\\n", addslashes($html1)),preg_replace("/\r?\n/", "\\n", addslashes($html2)),preg_replace("/\r?\n/", "\\n", addslashes($html3)));
		$titles = array(preg_replace("/\r?\n/", "\\n", addslashes($title1)),preg_replace("/\r?\n/", "\\n", addslashes($title2)),preg_replace("/\r?\n/", "\\n", addslashes($title3)));

to
$lats = array($lat1,$lat2,$lat3,$lat4);
		$longs = array($long1,$long2,$long3,$long4);
		$pubs = array($pub1,$pub2,$pub3,$pub4);
		$htmls = array(preg_replace("/\r?\n/", "\\n", addslashes($html1)),preg_replace("/\r?\n/", "\\n", addslashes($html2)),preg_replace("/\r?\n/", "\\n", addslashes($html3)),preg_replace("/\r?\n/", "\\n", addslashes($html4)));
		$titles = array(preg_replace("/\r?\n/", "\\n", addslashes($title1)),preg_replace("/\r?\n/", "\\n", addslashes($title2)),preg_replace("/\r?\n/", "\\n", addslashes($title3)),preg_replace("/\r?\n/", "\\n", addslashes($title4)));


I havent tested this but I think that's what is required.

Anthony
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
Last Edit: 12 years 2 months ago by Anthony Olsen.
The administrator has disabled public write access.
That worked however the only issue now is the marker won't show up.
  • cherubini's Avatar
  • cherubini
  • 3 Month Basic
  • 7 posts
  • Karma: 0
The administrator has disabled public write access.
Hi there,

got a link you can share?
  • Seth's Avatar
  • Seth
  • Moderator
  • 8358 posts
  • 225 Thanks
  • Karma: 202
The administrator has disabled public write access.
  • cherubini's Avatar
  • cherubini
  • 3 Month Basic
  • 7 posts
  • Karma: 0
The administrator has disabled public write access.
Can you send me the edits you made her e- attached in a zip file and I will take a look.

Anthony
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
Here you go Anthony!
Attachments:
  • cherubini's Avatar
  • cherubini
  • 3 Month Basic
  • 7 posts
  • Karma: 0
The administrator has disabled public write access.
Sorry I think I missed this line:
for ($i = 0; $i < 3; $i++) {

If you change it to 4 it should work.
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
That worked! Thank you Anthony!!!!
  • cherubini's Avatar
  • cherubini
  • 3 Month Basic
  • 7 posts
  • Karma: 0
The administrator has disabled public write access.
thanks for the update

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
I'd like to contribute for those who come after me. I needed like 30 markers (yes, don't ask)

The xml changes given above are mildly wrong, params should be fields, and the $title needed to be grown as well.

Anyway wanted to attach the mod_jbmaps.php and the mod_jbmaps.xml grown to 30 markers as zip or as php and xml, but the attachment upload field does not let me. So here is a link (but I cannot guarantee its long term availability, so maybe you can find a way to keep this file on the jb site)


Blessings, and thanks for the good work,
Jelmar

P.S. It's a bit unwieldy as a normal module, but maybe you could release a 'jbmaps module extreme' or 'extended'. But I like 'extreme' better:P Well, one can dream.
  • fluxus's Avatar
  • fluxus
  • 12 Month Developer
  • 204 posts
  • Karma: 2
Last Edit: 11 years 3 months ago by fluxus.
The administrator has disabled public write access.
Hi

Thanks for this - very much appreaciated

+1

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers