Google Maps Module for V3 & V4

Discussion in 'Modules / Plugins / Modifications' started by Lhotch, Jul 29, 2008.

  1. Lhotch curmudgeon

    The google map module is module that collects address details from an ad and diaplays a google map inline with the ad or creates a link to open a map in a new browser window.

    The module allows for customization via the admin interface shown below.

    The module can be set to pull the address details form EITHER "extra fields" OR from "Registration fields" but NOT. You have to chose one or the other in the modules administration.

    To use this module you MUST create an extra field that is a dropdown with 2 values "yes" and "No" and it must be set to be "displayed" for the category that wil have the ability to display inline maps. This extra fild is what will allow your users to turn the map display on and off.

    If you chose to collect address data from extra fields then you must also create an extra field for....

    Address
    City
    State
    Zip
    Country

    These need to be single line text fields.


    Attached is a copy of the readme.txt file with the installation instructions. Please read it very carefully and if you have questions or doubts please ask BEFORE purchasing this module. I also recommend that potential non-US customers try a few addresses on googles website to make sure it properly creates a map. You can also send me an address and I will place a test ad on one of my sites so we can make sure the module works properly for your area.

    This module is sold AS IS with no warantly expressed or implied. Support will be given on a best effort basis to get the module working as designed. Modifications and customization is done at your own risk and expense.

    Because it works with google maps and interfaces with their site, there may come a time that Google may make changes that effects the operation of this module. Since I have no control over google I can not control their changes and therefor can not gaurantee this module will work forever. I will make an effort to keep the script working and any updated versions of the script will be free to existing users.

    Time permitting I will likely keep this module current and working but there is no gaurantee or promise of that.

    The price for this module is $50 USD per domain name. Installation is available for an additional cost.

    Attached Files:

  2. crystal Customer

    Hi Larry,

    Is it possible to use this mod without the address field, so that the map just shows city, state, zip, country? (The marker would be on the city).

    Also, can the "directions" popup be added to the map? (When you click the marker you can add your address and it will bring up directions to the listing address).

    Thank you!
  3. Lhotch curmudgeon

    If you chose to use the users registration fields there is no option to display just the city.

    However,if you create extra fields, and set the module to use them for the address, then you can set the extra fields so they are not required. That way people can leave the address blank and a map will be created for just the city.

    Nope. The whole direction aspect was not working with the API so that has been removed.
  4. gppromano Customer

    Hi Larry,

    It could create two fields latitude and longitude, to manually enter the coordinates, when google maps, not locate them properly advertisement in a map.

    Thanks
  5. ksuralta Customer

    Larry,

    Where could we purchase this module?

    Thanks,
  6. Lhotch curmudgeon

    You can contact me via PM through the forum here or e-mail through the forum. Im going to be out of town with limited or no access to E-mail unti Aug 7th though.
  7. Lhotch curmudgeon

    Module veriosn 1.2 has been release.

    - It fixes a variable conflict in the externalmap.php which prevented the external map links from working properly.

    - additions to readme.txt file.

    Existing clients can send me an e-mail or PM through the forum or from techconnx.net if you would like the updated files.

    To upgrade from V1.1 to V1.2 all you need to do is upload the new files over your old files.
  8. MiśUszatek New Member

    Is there any way to use this map and hide created extrafield from showing up in the listing?
    It is kind of pointless to lets say MAP: YES while map is shown below

    I would rather hide that from listing display and keep it only when listing is created.
    Any ideas what to change?
  9. Lhotch curmudgeon

    It needs to be set to displayed when created so its passed to the templates and in turn its value used to show/hide the map.

    However, you can selectivly hide exta fields in the viewlisting template.

    for example in the default V4 template file you have the section like this that goes over the extra fields and displays them.

    Code:
    {* Extra Fields *}
        {foreach from=$extrafields item=extras}
           <tr>
              <td><strong>{$extras.title}:</strong></td>
              <td>
                  {if isset($extras.value)}
                      {foreach key=key item=item from=$extras.value}
                          {$item}<br />
                      {foreachelse}
                          {$extras.value}
                      {/foreach}
                   {/if}
               </td>
            </tr>
    {/foreach}
    {* End Extra Fields *}
    
    While looping over the fields you can add logic to check for a field name and then not display it, like this....

    Code:
    {* Extra Fields *}
        {foreach from=$extrafields item=extras}
           {if $extras.title<>"Map Available"}
            <tr>
              <td><strong>{$extras.title}:</strong></td>
              <td>
                  {if isset($extras.value)}
                      {foreach key=key item=item from=$extras.value}
                          {$item}<br />
                      {foreachelse}
                          {$extras.value}
                      {/foreach}
                   {/if}
               </td>
            </tr>
          {/if}
    {/foreach}
    {* End Extra Fields *}
    
    now the above simply surrounds the loop in an evaluation and IF the extra field name DOES NOT EQUAL "Map Availabe" then the exta field will be displayed.

    Make sense?
  10. MiśUszatek New Member

    thanks, perfect solution
  11. MiśUszatek New Member

    One more question....

    ....is there any way to display map in listing preview, so user will see if his map is correct?
  12. Lhotch curmudgeon

    No there is not. The best thing to do is to tell people to test their address at google first. They can also go back in and edit the address after the ad is placed.
  13. MiśUszatek New Member

    where I should look if I want to change GIcon?

    I was looking at iconImage parameter in GoogleMapAPI.class.php ....is that correct file? If so...what exactly I need to change to provide URL to icon and shadow?
  14. Lhotch curmudgeon

    I dont know exactly what needs to be changed or if its possible with the API that I use. You would have to experiment.
  15. MiśUszatek New Member

    I know exactly what but since I don't have programing skills I would need a little guide

    in API guide I found note:
    so I placed this in the code:

    .....but that didn't work (since I'm not a programmer probably i messed up something )
  16. MiśUszatek New Member

    well, I'm not sure if I placed this line in correct place but it didn't work, so I checked my old project for different site where I used custom icon for Google map.




    look at part of current GoogleMapAPI.class.php

    now I compared this with my custom google map icon from different project:


    so everything is defined by icon.image & icon.shadow which in this GoogleMapAPI is defined as $iconImage.
    Now... where exactly and how I can define URL for that?
  17. Lhotch curmudgeon

    where you have

    icon.image = \"template/tm/images/red_arrow.png\";

    you could tryusing a complete URL.....ie
    icon.image = \"http://mysite.com/template/tm/images/red_arrow.png\";

    But I cant guarantee it will work.

    One thing you have to realize, the API release by google is for using javascript. The API I use is a class which takes PHP and creates the javascript to create the map. All I did was create a wrapper to allow easy implementation of the php API to be used with 68C.

    Because of the way the PHP API interacts with the javascript API I did have some issues with getting images to display on the map marker due to semi hard coded paths in the API and I have not pursued a solution because its just a fluffy add on and not realy necessary for the modul to work as I designed it.
  18. newcastledirectory Hunter Classifieds.com.au

    Google Map

    Hi Larry
    I am still hopping that you figured out why the module will not work on my suite yet?

    SS
    Newcastledirectory
    Hunter Classifieds.com.au
  19. Lhotch curmudgeon

    Its not a problem with the module but how your site is running. You have 68C installed in the root of one domain, then you haveit installed in a subdirectory, which is a subdomain.

    While normally this isnt a problem, it appears that you 68C site is using some files from the root doamin and others form the subdomain and in turn the files are located in 2 different places and because of this when the map modul coad is added to the proper template its not being loaded because your site is using files from the other install.

Share This Page