Pregunta

I was hoping for some clarification on when and where you can call certain methods.

  • clusterer (Do you access this through the handler? Do you clear the clusterer as a whole, or do you clear individual markers from the clusterer?)
  • addListener (I see this sitting in base_builder.coffee, but have no idea how to interact with it)
  • @hash = Gmaps4rails.build_markers(@events) do |event, marker| (Do all of the builders work here?)
  • primitives (when, maybe why, would I need to use these? I see it in the common.coffee, which is why I ask. I don't want to be missing anything.)

I'm sure I'll have more, as I keep using it... but these should get me moving nicely.

update

new question...

¿Fue útil?

Solución

  • clusterer (Do you access this through the handler? Do you clear the clusterer as a whole, or do you clear individual markers from the clusterer?)

In 2.0.4 you can do handler.removeMarkers(array) and handler.removeMarker(marker)

  • addListener (I see this sitting in base_builder.coffee, but have no idea how to interact with it)

only useful if you create your own builder, you can access the same method thanks to the primitives, or write it with plain google maps commands: do you really need to abstract on your level?

  • @hash = Gmaps4rails.build_markers(@events) do |event, marker| (Do all of the builders work here?)

It's just a convenient way to create json. If you need custom json, build it with your own json builder.

  • primitives (when, maybe why, would I need to use these? I see it in the common.coffee, which is why I ask. I don't want to be missing anything.)

This is an abstraction in the gem: as an injected dependency it lets me test easily. You can use it, but its not required.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top