Comments (8)
Can you confirm that this is necessary if the doctype is set as you point out in issue #49 ? I've tested successfully in IE9 without messing with namespaces but I haven't been closely following the latest revisions.
from polymaps.
The SVG namespace will be required for SVG to be viewed. It is just a core requirement of SVG according to the SVG specification, and according to most viewers.
I wasn't able to test this though because I see that with the IE9 branch version "simplegeo-polymaps-v1.6.2-34-g846d253" the doctype is specified, however, the Bing and Nasa samples (and probably others) don't appear to be loading in the SVG element at all in both FireFox and IE9, so something in this build is critically broken.
from polymaps.
The IE9 branch doesn't appear to run in Opera 11 either. If you could get the IE9 branch running in FFox or Opera then I can try to get it working in IE9. I'm just at a loss right now as to where to start. Thanks
from polymaps.
I'll try to get the IE9 branch working in Firefox tonight, stand by.
Looking more closely at the namespace code, I note that po.svg() is used to create an svg element as a container in the examples and throughout the main polymaps code to create vector graphics and images. It creates svg elements with a namespace:
https://github.com/simplegeo/polymaps/blob/master/src/Svg.js
https://github.com/simplegeo/polymaps/blob/master/src/ns.js
Is there something else we should be doing in order to be hygienic?
from polymaps.
Hmm, looks like something must be awry because when I view the DOM in the browser in Opera or IE's Developer tools, the namespace is missing in this and all of the other PolyMaps examples I have viewed, such as:
http://polymaps.org/ex/pale-dawn.html#12.00/37.7649/-122.4195
However, if you view the DOM for any of the SVG test suite files, you'll see the SVG namespace there - for example:
http://www.w3.org/Graphics/SVG/Test/20061213/svggen/color-prof-01-f.svg
Would be great if you have time to track that down, otherwise I can try this weekend. Thanks again, really cool stuff overall! Hope I can contribute some to it.
from polymaps.
Thanks for the extra details, I'll see if it's the same on Opera for Mac.
from polymaps.
It looks like in Opera (11.00 Mac) if you inspect the svg element's properties it does have a namespace set, it's just not displayed in the DOM viewer. The REPL confirms it:
>>> document.getElementsByTagName('svg')[0].namespaceURI
"http://www.w3.org/2000/svg"
Does the same happen in IE9's inspector/console?
That said, I've done a full review of the demos in Opera and almost all of them are buggy in some respect (mainly to do with the initial map size, everything seems fine if you resize the window).
Meanwhile I've merged from master onto the ie9 branch and tested a few examples using Firefox 4 beta 8 and Firefox 3.6 - both seem to work fine. Are there specific problems you're seeing? Any errors thrown?
from polymaps.
As you say, PolyMaps does run fine in FireFox 4.
Yes,the namespaceURI does appear in the DOM in IE9 with this query: document.getElementsByTagName('svg')[0].namespaceURI
I have some screenshots that show the script console errors in both IE9 and Opera.
In IE9 the error occurs on zooming and is:
SCRIPT438: Object doesn't support this property or method
polymaps.js, line 778 character 5
This is the code it has trouble with, so one of these variable might not be getting set in IE9 for some reason:
// set the layer transform
container.setAttribute("transform",
"translate(" + (mapSize.x / 2) + "," + (mapSize.y / 2) + ")"
+ (mapAngle ? "rotate(" + mapAngle / Math.PI * 180 + ")" : "")
+ (mapZoomFraction ? "scale(" + Math.pow(2, mapZoomFraction) + ")" : "")
+ (transform ? transform.zoomFraction(mapZoomFraction) : ""));
from polymaps.
Related Issues (20)
- Upgrade polymaps.org to 2.5.1 -- Currently examples breaking in IE9/Firefox HOT 2
- 'show' event is called with bad data the first time
- How to disable wrap-around? HOT 9
- Load function should be called with layer as context
- Polymaps has stopped working in Firefox HOT 3
- Maps start jumping in Chrome when dragging
- Custom Coordinate systems or Projects? HOT 2
- Round up in fractional zooming
- Examples don't work in firefox HOT 4
- [enhancement] Add missing bower.json. HOT 1
- SOURCE CODE FOR IMAGE MAP USED IN NEWSPAPER HOT 1
- Attaching event listeners to geoJson layer HOT 1
- Navigation image viewport
- Overlays
- Examples on http://polymaps.org/ex/ not resizing. HOT 3
- how to add custom icons on locations and toolip on those
- Integrating polyMaps with angular2 webpack
- Using Polymaps with Mapbox
- Examples on website no longer work because of CORS
- Is polymaps dead ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polymaps.