[map module] get via map menu styling trouble

dotnature
dotnature's picture

Joined: 2005-10-26
Posts: 224
Posted: Wed, 2006-02-01 20:14

my map size is embeded to fit nicely into well I geuss an embedded gallery, but when I use the "get via a map" it uses the default map size I set in options (right?) but the menu is not taken into account and breaks the page. I geuss there 2 possibilities to fix this, is it possible to set the "get via map" map to a differant size than the default one or can I move that menu somewhere else.

See attachment for what I mean

AttachmentSize
menubleed.JPG59.57 KB
 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Wed, 2006-02-01 20:50

Well ... I see.

The Map you describe currently use the same size as the map define in your admin panel (assuming you are using 0.4.9 & up here) and will look like that :-)

A way to hack it and make it using a different size is to open the MapHeader.tpl file (still assuming the version you are using is 0.4.9) and toward the top, you will see this:

    var myWidth = {$map.mapWidth};
    {if $map.mode eq "Normal"}var minusW = {if $map.sidebar eq 1}210{else}10{/if}{if $map.LegendPos eq '0'}+175{/if};{/if}
    {if $map.mode eq "Pick"} var minusW = 410; {/if}
    {if $map.WidthFormat eq "%"} myWidth = getmapwidth(myWidth,minusW); {/if}

If you are using the "%" for the map sizes instead of the pixels, you can change the value of interest minusW = 410 to a higher number and it would reduce the map size to smaller when "picking" coordinates.

If you are using the px sizes for the map, you would need
after
var myWidth = {$map.mapWidth};

to add the following line:
{if $map.mode eq "Pick"} myWidth = thesizeyouneedgoeshere; {/if}

If you want to get fancy and move the "menu" area somewhere else, you need to open ShowMap.tpl.
Then the display is done using a table: 1 TR with 2 TDs (TD 1 is the map, TD 2 is the Menu)

The Map TD is toward the top

    {if $map.mode eq 'Normal'}
      <h2>{g->text text="Photo Map"}{if isset($map.Filter)}<span class="giWarning"> {g->text text="Filtered on"} {$map.Filter}</span>{/if}</h2>
    {else}
      <h2>{g->text text="Grab coordinate from Map"}</h2>
      <table border=0>
      <tr>
      <td rowspan=2>
    {/if}

Between {else} and {/if} is the definition of the table and the beginning of the first TD

The Menu TD is toward the bottom

      </td>
      <td valign=top>
      <h2 class="giSuccess">{g->text text="MENU"}</h2><br/>
      (...)
      </td></tr>
      </table>

If you're having trouble or are not using 0.4.9c let us know :D

-------------------------
The Termite :-)

 
dotnature
dotnature's picture

Joined: 2005-10-26
Posts: 224
Posted: Wed, 2006-02-01 22:16

hm ok well I ran into a problem I was going to try first method since seemed easy so I changed my map settings
for width and height from px to a % (74, 90) clicked save and fit fine but my default zoom level is messed up its shows same zoom level no matter what its set at (1-17) ( http://dotnature.com/index.php?option=com_gallery2&Itemid=38&g2_view=map.ShowMap&g2_Group= )<----this is set to lvl 17 zoom

clicking the auto zoom and center button does reposition it my 2 markers at a lvl 17 zoom yet it shows it more like at a lvl 10 zoom.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Wed, 2006-02-01 22:50

Well here is a new bug :-)

What's happening is that I "assumed" (very wrong I was of course) that when you use the "%" feature you would use also the "AutoCenter and zoom" so...

since you're not, it basically "recalculate" the zoom for you anyway (since the size of the map is calculated dynamicaly it has too) and then doesn't autocenter (coz you actually didn't tell it too ...)

Bottom line you end-up with a map that is "Auto-zoomed" to the -best- level but doesn't center to the marker. That's not what we want really :)

So now a change needs to be done to the MapHeader.tpl to fix that :-)

Try to change the line 91 from
{if $map.HeightFormat eq "%" or $map.WidthFormat eq "%"}
to
{if $map.AutoCenterZoom and ($map.HeightFormat eq "%" or $map.WidthFormat eq "%")}

Also need to make a change to ShowMap.inc around line 1041, change:

          if ((array_key_exists('AutoCenterZoom',$param)) and ($param['AutoCenterZoom']==1))
          {
            $map['centerLongLat']=$center;
            $map['zoomLevel']=$zoom;
          }else{
            $map['centerLongLat']=$param['centerLongLat'];
            $map['zoomLevel']=$param['zoomLevel'];
          }

for

          if ((array_key_exists('AutoCenterZoom',$param)) and ($param['AutoCenterZoom']==1))
          {
            $map['AutoCenterZoom']=1;
            $map['centerLongLat']=$center;
            $map['zoomLevel']=$zoom;
          }else{
            $map['AutoCenterZoom']=0;
            $map['centerLongLat']=$param['centerLongLat'];
            $map['zoomLevel']=$param['zoomLevel'];
          }

and let me know how it behaves :-)

Thanks!
-------------------------
The Termite :-)

 
dotnature
dotnature's picture

Joined: 2005-10-26
Posts: 224
Posted: Thu, 2006-02-02 00:15

Sorry forgot to mention I was using 0.4.8e Ill update the module and then apply changes if needed.

*update

Been unable to get the latest version to work :( keep getting the following erros after activate

Quote:
Warning: loadtemplate(modules/map/includes/MapAdminViewInit.inc): failed to open stream: No such file or directory in /home/site/public_html/gallery2/modules/map/MapSiteAdmin.inc on line 242

Warning: loadtemplate(modules/map/includes/MapAdminViewInit.inc): failed to open stream: No such file or directory in /home/site/public_html/gallery2/modules/map/MapSiteAdmin.inc on line 242

Warning: loadtemplate(): Failed opening 'modules/map/includes/MapAdminViewInit.inc' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/site/public_html/gallery2/modules/map/MapSiteAdmin.inc on line 242

Warning: loadtemplate(modules/map/includes/MapAdminEdits.inc): failed to open stream: No such file or directory in /home/site/public_html/gallery2/modules/map/MapSiteAdmin.inc on line 268

Warning: loadtemplate(modules/map/includes/MapAdminEdits.inc): failed to open stream: No such file or directory in /home/site/public_html/gallery2/modules/map/MapSiteAdmin.inc on line 268

Warning: loadtemplate(): Failed opening 'modules/map/includes/MapAdminEdits.inc' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/site/public_html/gallery2/modules/map/MapSiteAdmin.inc on line 268

Warning: array_key_exists(): The second argument should be either an array or an object in /home/site/public_html/gallery2/modules/map/MapSiteAdmin.inc on line 271

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Thu, 2006-02-02 03:45

Did you check if the file was there at all ? MapAdminViewInit.inc in the includes folder ?

Let us know
-------------------------
The Termite :-)

 
dotnature
dotnature's picture

Joined: 2005-10-26
Posts: 224
Posted: Thu, 2006-02-02 05:00

yep its there I thought it was an updating problem so I then uninstalled it then deleted the entire module like 4 times, uploaded new one and same error everytime. I will download it again maybe it got corrupted.

* update

I realize the problem though not sure why it would happen, I have to use the /gallery2/ url to edit the admin for it to work
If I admin it from embedded mode it wont install. (using joomla)

After the install worked from gallery2 admin I still get errors and cannot admin it from embeded site url, which was not a problem in .4.8.e , im sure something changed in code that borked this. I would love if this worked as users wont be able to add phtos to the map.

Also on a non-related note with basic install with no features clicked I get some part of the legends text
, actually says "Lege" in ie and "Legend(s) in FF on far right of map http://dotnature.com/index.php?option=com_gallery2&Itemid=38&g2_view=map.ShowMap&g2_Group=

2 more bugs for you :)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Thu, 2006-02-02 12:47
dotnature wrote:
yep its there I thought it was an updating problem so I then uninstalled it then deleted the entire module like 4 times, uploaded new one and same error everytime. I will download it again maybe it got corrupted.

* update

I realize the problem though not sure why it would happen, I have to use the /gallery2/ url to edit the admin for it to work
If I admin it from embedded mode it wont install. (using joomla)

After the install worked from gallery2 admin I still get errors and cannot admin it from embeded site url, which was not a problem in .4.8.e , im sure something changed in code that borked this. I would love if this worked as users wont be able to add phtos to the map.

Also on a non-related note with basic install with no features clicked I get some part of the legends text
, actually says "Lege" in ie and "Legend(s) in FF on far right of map http://dotnature.com/index.php?option=com_gallery2&Itemid=38&g2_view=map.ShowMap&g2_Group=

2 more bugs for you :)

Ok that's precisous info. It's most likely a problem with paths. I will have to check on that.

Can you post both bugs in the sourceforge so I don't forget I might not be able to work on it until this week-end :)

Thanks!

 
dotnature
dotnature's picture

Joined: 2005-10-26
Posts: 224
Posted: Thu, 2006-02-02 16:12

Ok will do for some reason I can see no options to add to bugs or features on sourceforge, the only thing I can sumbit to is the submit new link and the catagories are none and interface(example) ?

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Thu, 2006-02-02 17:14

I see your TEST bug thought ...
-------------------------
The Termite :-)

 
dotnature
dotnature's picture

Joined: 2005-10-26
Posts: 224
Posted: Thu, 2006-02-02 18:49

dog sorry figured it out so many adds I couldn't find the link