[SOLVED] Separate map icon for Company Headquarters?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
michaywood
Power Poster
Power Poster
Posts: 280
Joined: Thu Apr 15, 2010 12:27 am
Location: Georgia

[SOLVED] Separate map icon for Company Headquarters?

Post by michaywood »

Hello CMSMSers!

I have got my CGGoogleMap and Company Directory search hooked up and working wonderfully! Now I'm wondering, is it possible to add a different marker icon for one or a few of the locations? Any ideas?

Thanks in advance!
Last edited by michaywood on Thu Jul 19, 2012 9:27 pm, edited 1 time in total.
User avatar
magallo
Dev Team Member
Dev Team Member
Posts: 121
Joined: Thu Mar 24, 2011 12:37 am

Re: CGGoogleMaps - Separate map icon for Company Headquarter

Post by magallo »

When i first used CGGoogleMap i was also hoping to be able to add multiple locations (pushpins) in one place.

Unfortunately that wasn't available so i had to come out with a workaround:

1) I used module "Listit2" to create the locations where i added name, lang and longitudes.

2) I then created a UDT that would loop through the records and generate a javascript to retrive the pushpins. You can find the script on google maps api. I simply adapted it to get my own data.

3) On the actual page i added the map and imported all the needed javascripts (with the udt) to the Metadata

Here you can see it in action
http://www.sbginvestors.com/index.php?p ... erties-map

I hope this puts you in the right direction.
Hopefully when i have a bit more time i'l write a step-by-step tutorial.

M
Magal Hezi
Pixel Solutions, Technology Partners
magal@pixelsolutions.biz | pixelsolutions.biz

Image
igners
Forum Members
Forum Members
Posts: 16
Joined: Tue May 22, 2012 2:40 pm

Re: CGGoogleMaps - Separate map icon for Company Headquarter

Post by igners »

Im trying to do a very similar thing. I have a map linked up to company directory. Within company directory there is a field definition where they select from a drop down what type of company they are from a choice of 3. What I really need is a different marker for each one.

I found this on calguy1000.com -

"This is a minor update to this module. I've added another custom field type: "Dropdown". This allows you to build dropdown lists, and allow a single value from that dropdown to be associated with a product.

I use this feature, along with the new CGGoogleMaps module to customize Google Map Icons for each company listing."


So it looks like its possible, but its beyond my web designer brain to work it out.
michaywood
Power Poster
Power Poster
Posts: 280
Joined: Thu Apr 15, 2010 12:27 am
Location: Georgia

Re: CGGoogleMaps - Separate map icon for Company Headquarter

Post by michaywood »

Good to know it's possible, but I have yet to figure it out.

I was able to add a point dynamically to the map using

Code: Select all

{cggm_add_dynpoint map=1 name='New York' address='New York, NY' icon='food'}
and this added the point to the map with the icon I wanted.

But once you use CompanyDirectory to do a search, it removes that dynamic point from the map and only shows the items out of the CD module.

I'm in the same boat with you where I'm more of a designer so I don't quite know how to do this either! Hopefuly someone can give some insight!
igners
Forum Members
Forum Members
Posts: 16
Joined: Tue May 22, 2012 2:40 pm

Re: CGGoogleMaps - Separate map icon for Company Headquarter

Post by igners »

I think I've solved this by horribly butchering the code from various posts on this forum - thanks to the original posters for their efforts.

The first part is for the info bubble, the second part looks for the category assigned in the CD module and assigns a marker to each. In this example category 'partners' gets a food icon, category 'others' gets a house.

michaywood - if you want more info or explanation PM me and I will pass you my email address.

{CompanyDirectory assign="" detailpage=""} 
{foreach from=$items item='entry'}   
{assign var='name' value=$entry->company_name}
{assign var='address' value=$entry->address} 
{capture assign='description'}
<div style="float: left; margin: 0 0 5px 5px; width: 300px">
<h4>{$entry->company_name}</h4>
<p><a href="{$entry->detail_url}">Find out more</a></p>
</div>
{/capture}
{if !empty($entry->categories)} {* categories has value *}
  {assign var='get_cat' value=$entry->categories|@array_keys}
  {capture assign='cat'}{', '|implode:$get_cat}{/capture}{* get category value *}
  {foreach from=$get_cat item='one'}
  {if $one == 'Partners'}
     {cggm_add_dynpoint map=1 name="$name" address="$address" description="$description" icon='food'}
  {/if}
{/foreach}
{foreach from=$get_cat item='two'}
  {if $two == 'Others'}
     {cggm_add_dynpoint map=1 name="$name" address="$address" description="$description" icon='house'}
  {/if}
{/foreach}
{/if}
{/foreach}

{CGGoogleMaps map='1' zoom='1' }
michaywood
Power Poster
Power Poster
Posts: 280
Joined: Thu Apr 15, 2010 12:27 am
Location: Georgia

[SOLVED] Re: Separate map icon for Company Headquarter

Post by michaywood »

I got it figured out! And it was WAYYY easier than I was expecting...

All I was wanting was a special separate dot for our Headquarters on the map. Here are the steps taken:

1. Login to your CMSMS and go to CGGoogleMaps module
2. You'll see your map you've created, click on the marker icon on the far right (next to the green check and edit buttons). This will allow you to put in map points for that map!
3. Put in the info and select the icon you want to use and hit save!
4. Now when you pull up the blank map, it shows your headquarters location. And if you do a search with CompanyDirectory, it shows all the CompanyDirectory points while STILL showing the Headquarters point that was put in in the CGGoogleMaps module!

So there we go! Different icon for the company headquarters! sweet!
User avatar
sbupravi
Power Poster
Power Poster
Posts: 257
Joined: Sun Oct 07, 2012 9:29 pm
Location: Adler

Re: [SOLVED] Separate map icon for Company Headquarters?

Post by sbupravi »

I did using cggm_add. But how to insert a description of the label on the map?
And on the same map display addresses (labels) of all companies?
Post Reply

Return to “Modules/Add-Ons”