我有一张我在rails中使用google maps for rails gem创建的地图.它适用于Chrome和Safari,但它不会在Firefox 29中显示自定义.svg标记.它会显示群集的自定义图像(这是一个png).
我已经碰到了很久以来的一些主题(FF 8和9),它说有一个问题在9或10中与cors有关.然而,它似乎暂时不是一个问题,特别是对于29.
有谁知道这是一个firefox问题还是google maps for rails gem问题?如果它是一个什么是解决方案.
更新: 为png交换svg现在正常工作.然而,这并不能解决潜在的问题.我想使用svg,所以我可以传入颜色变量.
仍然没有运气,chrome和firefox都显示该图像正在开发人员工具中下载.图像目录中的firefox和chrome中可以查看该图像.以下是我的SVG的代码:
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="20px" y="20px"
viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
<circle fill="#45A6DD" cx="7.5" cy="7.5" r="5.6"/>
</svg>
Run Code Online (Sandbox Code Playgroud) 这是我的第一个ruby应用程序.我是一个堆栈溢出的处女......当我运行以下程序时:
class NameApp
def intialize(name)
@names = []
end
def name_question
print "What is your name? "
answer = gets.chomp
@names += answer.to_s
puts "The number of characters in your name is " + names.length
end
def name_length
if @names.length > 25 then
print "Your name is longer than 25 characters."
else
print "Your name is too short."
end
end
end
name_app = NameApp.new("Test1")
name_app.class # => NameApp
name_app.name_question
name_app.name_length
Run Code Online (Sandbox Code Playgroud)
我得到这个简单的错误消息结果:
name.rb:26:in `initialize': wrong number of arguments(1 for 0) (ArgumentError) …Run Code Online (Sandbox Code Playgroud)