进口聚合物核心 - 脚手架打破google地图 [英] import polymer core-scaffold breaks google maps

查看:186
本文介绍了进口聚合物核心 - 脚手架打破google地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些工作dart聚合物代码,显示一个谷歌地图上的一些标记。它花了我一段时间,让它们出现,因为它似乎初始化例程有点bit懒,它好像有时没有足够的时间加载地图div,在它试图渲染。无论如何,正如我说的,我得到了工作。现在我想在它周围放置一个核心脚手架,因为他们在许多演示。我添加此行...

 < link rel =importhref =packages / core_elements / core_scaffold。 html> 

...整个事情打破了,我得到控制台错误:

 异常:类'GElement'没有实例方法'[]'。 

NoSuchMethodError:method not found:'[]'
接收者:'GElement'的实例
参数:[maps]



我注释掉所有其他行,并将其缩减为一个。

解决方案

(截至今天),使用DartEditor 1.5.8并升级到聚合物0.12.0

 依赖项:
polymer:'> = 0.12.0< 0.13.0'

这将core_element和paper_element升级到0.1.x(之前为0.0.x)。这看起来是固定的(虽然似乎仍然有问题的图标由ids),我可以运行一个简单的脚手架的例子( https://github.com/dart-lang/core-elements/blob/master/example/core_scaffold.html )。你可能想再试一次!


I have some working dart polymer code that shows a google map with some markers on it. It took me a while to get those to show up, as it seems the initialization routines are a bit wonky and it's as if sometimes there is not enough time to load the map div before it tries to render. Anyway, as I said I got that working. Now I wanted to put a core-scaffold around it, as they do on many demos. The minute I add this line...

<link rel="import" href="packages/core_elements/core_scaffold.html">

...the whole thing breaks, i get the console error:

Exception: Class 'GElement' has no instance method '[]'.

NoSuchMethodError: method not found: '[]'
Receiver: Instance of 'GElement'
Arguments: ["maps"]

I commented out all other lines and reduced it to just that one.

解决方案

(As of today), using DartEditor 1.5.8 and upgrading to polymer 0.12.0

dependencies:
  polymer: '>=0.12.0 <0.13.0'

this upgrades core_element and paper_element to 0.1.x (was 0.0.x before). This now looks fixed (although there seems to be still issues with icon by ids) and I'm able to run a simple scaffold example (https://github.com/dart-lang/core-elements/blob/master/example/core_scaffold.html). you might want to give it another try!

这篇关于进口聚合物核心 - 脚手架打破google地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆