[map module 0.5e] more map madness, move history and theme stuff

dotnature
dotnature's picture

Joined: 2005-10-26
Posts: 224
Posted: Mon, 2006-03-27 22:39

Ok Ive was working on the map a lot today so sorry for the all these posts.

First im not sure if this is meant to be or not, but in the "move history" links if you have zoomed around your map and click the "start" link you are re-positioned with the default center but with your current zoom level (not default "start" one). This can be wierd since my map is centered in the ocean if im zoomed in somewhere and click start Im looking at a lot of blue.

Secondly I like to change the placement of the filter block position, I ran into to many problems using left/right placements with a wide map they would often display under the map, load wierd , and cause havoc in ie when trying to style them {ff too}. Im trying to get the filter block to display on the same line as the "photo map" or "filtered on" text. I tried add some of the map.tpl code into showmap.tpl but it didnt work, I figure Ill have to put both into a table to show next to each other. Or should I just get rid of the "photo map" text and try to call $map.Filter in map.tpl so it all shows up on one line. Anyhow what ya think.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Mon, 2006-03-27 22:48

First problem: I'm not sure :-) Floridave will have more insight on it :-)

Second problem: The filter block can be on top/right/left or bottom but indeed isn't able to be next to the "photo map" text it's right underneath (when placed on top)

This can be changed easily within ShowMap.tpl

this displays the block up to underneath the text "Photo Map":

        {if $map.mode neq "Pick" and isset($map.ShowFilters) and $map.ShowFilters eq "3"}
         {g->block type="map.map"}
        {/if}

This displays the text "Photo Map":

    {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}

so if you want them on the same line, just move the first block of code inside the <h2> tag of the second piece of code and that should do the trick when you select "TOP" for the filter list position

good luck ;)
-------------------------
The Termite :-)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2006-03-27 23:14
dotnature wrote:
First im not sure if this is meant to be or not, but in the "move history" links if you have zoomed around your map and click the "start" link you are re-positioned with the default center but with your current zoom level (not default "start" one). This can be wierd since my map is centered in the ocean if im zoomed in somewhere and click start Im looking at a lot of blue.

That is Not the intended behavior. I will look into this when I get home from work and get the kids fed and to bed.

Dave

 
dotnature
dotnature's picture

Joined: 2005-10-26
Posts: 224
Posted: Mon, 2006-03-27 23:59

Thanks termite was looking for that first bit of code, it didnt work out putting it into the h2 tag but I put it all into a styleable table and it looks great. Something like

<table width="100%" class="filterthing">
 <tr><td class="titlecell">
    {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></td>
      <td class="filtercell">
      {if $map.mode neq "Pick" and isset($map.ShowFilters) and $map.ShowFilters eq "3"}
     {g->block type="map.map"}
             {/if}
          </td></tr></table>

:) cheers

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2006-03-28 04:41
dotnature wrote:
First im not sure if this is meant to be or not, but in the "move history" links if you have zoomed around your map and click the "start" link you are re-positioned with the default center but with your current zoom level (not default "start" one). This can be wierd since my map is centered in the ocean if im zoomed in somewhere and click start Im looking at a lot of blue.

EDIT:
I CANT SEEM TO REPRODUCE>

Can you try with "Auto Center and Auto Zoom" enabled and see if that is the issue?

Dave

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Tue, 2006-03-28 04:53

I experience the same situation. I have auto center and zoom enabled.
Clicking Start indeed does go to the correct location, just not at
the correct zoom level.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2006-03-28 05:02

in mapheader.tpl can you find:
GEvent.addListener(map, "moveend", function mapMoved() { and add
alert(myZoom);
In mine whenever I move the map a JS alert says the zoom level I stareted with.
If it does not on yours then I need to find out why it is changeing.

Dave

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2006-03-28 05:08

I think it has to do with the auto center and zoom. I don't have enough markers yet to see if this is the case.
dotnature does have regrouped markers.
glamoid, do you?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2006-03-28 05:13

Confirmed. It is the regroup feature.
give me some time to figure this out. As I have no idea how this regroup stuff works.

Dave

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2006-03-28 05:25

Not extencivly tested and will let you test tonight / tomorrow:
in /templates/MapHeader.tpl find:

map.closeInfoWindow();
map.centerAndZoom(new GPoint({$map.centerLongLat}), myzoom);

and change to:

map.closeInfoWindow();
map.centerAndZoom(new GPoint({$map.centerLongLat}), {$map.zoomLevel});

Let me know if it works or not with auto-regroup and out center and zoom enabled.

Dave

PS. something in the back of my mind said I did that originaly and I changed it to myzoom for some reason. Lets hope I was dreaming.

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Tue, 2006-03-28 07:29

Checked quickly. It zoomed, almost correctly. Went to max zoom out; but,
Start was actually two levels less zoom.
I'll have to check tomorrow to see what my settings are to see if this
is what should happen.

 
Mozambique

Joined: 2005-11-29
Posts: 108
Posted: Tue, 2006-03-28 09:15
Quote:
Clicking Start indeed does go to the correct location, just not at
the correct zoom level.

Same in 0.4.10d

Moz

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Tue, 2006-03-28 11:47
floridave wrote:
PS. something in the back of my mind said I did that originaly and I changed it to myzoom for some reason. Lets hope I was dreaming.

The back of your mind is almost correct, I made that change because there was a bug with the start link as well ... I have a feeling we're hitting 2 bugs and each of them is the solution to the other one :-)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2006-03-28 14:39
Termitenshort wrote:
The back of your mind is almost correct, I made that change because there was a bug with the start link as well ... I have a feeling we're hitting 2 bugs and each of them is the solution to the other one :-)

I guess a solution is to put a if statment around that bit of code and check to see if the regroup feature is enabled?
Or
Is the original zoom location stored in the DB even if the user has "auto center / zoom" enabled or is it calculated on the fly?

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Tue, 2006-03-28 15:01
floridave wrote:
Is the original zoom location stored in the DB even if the user has "auto center / zoom" enabled or is it calculated on the fly?

When autocenter & zoom is enabled, the zoom level is calculated automatically on the fly because it might change depending on what's displayed ... This is the reason for the myzoom to be used ... I don't really see why the regropu feature would alter that ?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2006-03-28 15:32
    //Add a function to update the markers when the zoom change (for the regroup function)
    GEvent.addListener(map, "zoom", function(oldZoom, zoom) {

I think this is the issue. When the regroup feture is enable the value of myzoom gets changed.
Can we store the original starting zoom level in a session?

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Tue, 2006-03-28 16:15

Hey I tried something that. at first glance, appears to work (yous guys
may see why not though).

The original code mentioned above:

map.centerAndZoom(new GPoint({$map.centerLongLat}), myZoom);

that was said should be changed to:

map.centerAndZoom(new GPoint({$map.centerLongLat}), {$map.zoomLevel});

I changed to:

map.centerAndZoom(new GPoint({$map.centerLongLat}), startZoom);

To go with that I found:

    //Initialize the zoom and center of the map where it need to be
    map.centerAndZoom(new GPoint({$map.centerLongLat}), myZoom);

and added just after it:

{literal}
startZoom = myZoom;
{/literal}

Please see if it breaks anything or does not work.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Tue, 2006-03-28 16:26
Quote:
{literal}
startZoom = myZoom;
{/literal}

This is good, this is even better:

Quote:
var startZoom = myZoom;

no need for a {litreal} enclosure and better to create a new var just in case ;-))

Thanks for the idea !
-------------------------
The Termite :-)

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Tue, 2006-03-28 16:30

I just throw things and hope they stick. :-)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2006-03-28 16:37

Floridave buys everybody a beer after work. :-)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Tue, 2006-03-28 16:39

Sweeeeeeeet !
-------------------------
The Termite :-)

 
dotnature
dotnature's picture

Joined: 2005-10-26
Posts: 224
Posted: Tue, 2006-03-28 18:13

mmm beer, I get the second round!