Support Forum

  • Page:
  • 1

Change/set default marker in JB Maps2

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

Could you please advise if there is a way to change the default Google marker, so that when you add a new 'pin' it automatically uses a custom marker rather than having to go and update the marker's image path every time you add a pin?

ie. set the custom marker's path in the code so that it is the default marker?

Thanks in advance.

Chrysti
  • artful's Avatar
  • artful
  • LIfetime Developer - Big Bamboo
  • 37 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Hi Chrysti,

You can add markers via the markers tab

For example by default there is

maps.google.com/mapfiles/marker.png

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


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

I am aware of that area, but what I wanted to know was if there was any way I could set the default marker to my own, so that I can instantly add my own marker each time I click the map. Rather than having to go into the Marker tab and update it each time?

Chrysti
  • artful's Avatar
  • artful
  • LIfetime Developer - Big Bamboo
  • 37 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Hi Chrysti

I am not aware of a way to change this within the module admin, might be a nice feature request you could make.

However if you are comfortable customising the code, I think you will find the code in the module under >js>admin.js around line 275. Modifying this should enable you to load a custom map pin each time without changing. Of course you would need to re-package etc., which is likely to be outside of JB support.

I hope this helps, should give you a starting point.
regards Ian
  • iafdesign's Avatar
  • iafdesign
  • LIfetime Developer - Big Bamboo
  • 393 posts
  • 153 Thanks
  • Karma: 58
The administrator has disabled public write access.
Thanks Ian

I'll check with Rob tomorrow to see what he thinks on this

Rob made the map2 extension :)

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

I just checked with Rob and he agrees Ian's solution is the best way to do this

// Add a marker to the map and push to the array.
function addMarker(location) {
var marker = new google.maps.Marker({
markerid: markers.length,
position: location,
title: '',
icon: 'maps.google.com/mapfiles/marker.png',
windowcontent: '',
draggable: true,
map: map
});
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Thank you all, I'll give it a go.
  • artful's Avatar
  • artful
  • LIfetime Developer - Big Bamboo
  • 37 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
It worked!! Thanks again.
  • artful's Avatar
  • artful
  • LIfetime Developer - Big Bamboo
  • 37 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Thanks Ian

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
If you update and have edited the original file you would need to add the change back

Best of luck with the site

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