[Map Module 0.5.1d + history code breaks Safari]

floridave
floridave's picture

Joined: 2003-12-22
Posts: 26100
Posted: Sun, 2006-05-28 20:19

Map Module 0.5.1d + history code breaks Safari

I am having trouble getting the Safari browser to work. I don't have a Mac and use:
http://www.snugtech.com/safaritest/ for testing.
Example: http://langleycom.com/gallery2/main.php?g2_view=map.ShowMap

It seems that my history code is screwing things up. Reverting to the unmodded version seems to work.
Just wondering if any user of SVN and Safari experiences the same issue?
How does one troubleshoot Safari JS errors?

Dave

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2006-05-28 21:40

I have a MAC OSX Vmware instance. I'll do some test :-)

I also had installed the developpers tools so I should be able to find out what's wrong .... I'll let you know !
-------------------------
The Termite :-)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2006-05-28 21:40

PS: the latest SVN does the same thing :(
-------------------------
The Termite :-)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 26100
Posted: Sun, 2006-05-28 21:55

I think I found the issue:

// ================= mapMoved LISTENER =============
// ======= add history links to the div_history ====
GEvent.addListener(map, "moveend", function mapMoved() {

to:

// ================= mapMoved LISTENER =============
// ======= add history links to the div_history ====
GEvent.addListener(map, "moveend", function() {

I built a small page without all the stuff and tried again and it seems to work.

Dave

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2006-05-28 22:19

yep that seems to fix it for me too on the SVN version ... I'll update the SVN with this fix :-)
-------------------------
The Termite :-)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 26100
Posted: Sun, 2006-05-28 22:24

Great!
one other thing I noticed;
how do we change the CSS of the text of the custom map type(s) Satellite/map/hybrid?

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Mon, 2006-05-29 00:21

in MapHedaer.tpl

    MyMapTypeControls.prototype.CreateTextEl_ = function(button,text) {ldelim}
      var textel = document.createElement("div");
      textel.style.position = "absolute";
      textel.style.textAlign = "center";
      if (!IEVersion) textel.style.top ="3px";
      textel.style.left = "0px";
      textel.style.zIndex = 101;
      textel.style.width = "80px";
      textel.innerHTML = text;
      button.appendChild(textel);
    {rdelim}


    MyMapTypeControls.prototype.setButtonStyle_ = function(button,imgfile,id) {ldelim}
      var image = document.createElement("img");
      if (!IEVersion ||(IEVersion && IEVersion >= 7)) image.src = imgfile;
      else {ldelim}
        image.src = "{$map.gallerybase}modules/map/images/blank.gif";
        image.style.filter = "filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+imgfile+"')";
      {rdelim}
      image.id = id;
      button.appendChild(image);
      button.style.cursor = "pointer";
      button.style.position = "absolute";
      button.style.color = "white";
      button.style.font = "small Arial";
      button.style.padding = "2px";
      button.style.marginBottom = "3px";
      button.style.textAlign = "center";
    {rdelim}

This is what takes care of the CSS for these item. CreateTextEl_ write the actual text whereas setButtonStyle_ change the CSS for the buttons :-)

What did you notice ?
-------------------------
The Termite :-)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 26100
Posted: Mon, 2006-05-29 01:15
Termitenshort wrote:
What did you notice ?

Before we had a css for the custom control.
I would like to change the font-size and type. I can add that to the .tpl. But I would like to see a class added to the <div>?

I see the div is made with: document.createElement("div");
Is there a way to give the div its own class?

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Mon, 2006-05-29 03:12
floridave wrote:
Is there a way to give the div its own class?

Yes. button.class = "xyz"; :)