locked
VE v5 Safari Workaround RRS feed

  • Question

  • Does any one know of a workaround for getting VE version 5 to work with the Safari browser?  We currently implement the VE version 5 within our web site to show maps of locations.  Now we have to support Safari for the Mac.  Anyone have ideas?

     

    steven

    Friday, July 13, 2007 8:53 PM

Answers

  • Interesting, can you possibly elaborate as to how you managed to modify and have a working version of the V5 API?  From what I know due to XSS (Cross-site scripting) you have to take the entire VE API (the 500k .ashx file) without modifications otherwise the file will not work.  Is Safari possibly exempt from this? 

    Regards,
    Tuesday, July 17, 2007 10:37 PM
  • It worked for Safari, but I also have to support Opera. This solution did not work for Opera(v9.21) and the standard VEv5 does not work for Opera. The hacked-up v4 solution worked in Safari and Opera.  Unless anyone has other solutions, I will have to stay with the v4 hacked-up solution for Safari and Opera browsers.

    Thanks for the help, steven.

    Thursday, July 19, 2007 4:27 PM

All replies

  • There was a hacked-up version of the v4 script that worked on Safari; I've attempted to do the same for v5. You can download the result here:

    http://static.povo.com/js/MapControlv5Safari.js

    Using it is a little complicated; first you need to embed this script:

    <script type="text/javascript">
     var VEAPI_DisableAtlasCompat=navigator.userAgent.indexOf('Safari') != -1;
     function disable_text_selection(element) {
        if (typeof element == 'undefined') return;
            element.onselectstart = function() {
            return false;
            };
            element.unselectable = "on";
            element.style.MozUserSelect = "none";
            element.style.cursor = "default";
     }
    </script>

    Then include the above file.

    Then embed this script:

     <script type="text/javascript">
    var ffv = 0;
    var ffn = "Firefox/";
    var ffp = navigator.userAgent.indexOf(ffn);
    if (ffp != -1)
        ffv = parseFloat(navigator.userAgent.substring(ffp + ffn.length));
    if (ffv >= 1.5 || navigator.userAgent.indexOf("Safari") != -1) {
        Msn.Drawing.Graphic.CreateGraphic=function(f,b) {      
            return new Msn.Drawing.SVGGraphic(f,b);
        }
    }
    </script>

    Then include http://static.povo.com/js/SafariCompat.js.

    I can't claim that this makes everything work under Safari (for one, you can't draw filled polygons, and I haven't even looked at the 3D stuff), but it makes the basic map work for me.
    Tuesday, July 17, 2007 2:55 PM
  • Interesting, can you possibly elaborate as to how you managed to modify and have a working version of the V5 API?  From what I know due to XSS (Cross-site scripting) you have to take the entire VE API (the 500k .ashx file) without modifications otherwise the file will not work.  Is Safari possibly exempt from this? 

    Regards,
    Tuesday, July 17, 2007 10:37 PM
  • It worked for Safari, but I also have to support Opera. This solution did not work for Opera(v9.21) and the standard VEv5 does not work for Opera. The hacked-up v4 solution worked in Safari and Opera.  Unless anyone has other solutions, I will have to stay with the v4 hacked-up solution for Safari and Opera browsers.

    Thanks for the help, steven.

    Thursday, July 19, 2007 4:27 PM
  • Thank you for the contribution, I have been looking for a fix for some time.  I got it to work with Safari and that was my BIG issue.

    Thanks Again!!!
    Wednesday, July 25, 2007 4:48 PM
  • Yes, it did work in Safari (tested it in Mac OS X only), though my collection is not showing up at all. I am using v5 code to display the collection. Can collections be displayed under Safari when using your code?

    javier
    Friday, July 27, 2007 2:15 PM
  • Can I use this workaround in commercial uses?

     

    By the way, I have to include two files after both scripts. Otherwise, the page will be crushed.

    Wednesday, August 8, 2007 7:06 PM