Setting up Leaflet MarkerCluster in Meteor?

349 views
Skip to first unread message

Robert Persaud

unread,
Nov 18, 2013, 12:14:39 PM11/18/13
to meteo...@googlegroups.com
Hi, so I'm using meteor to build a map app - and here's how I'm organized.
That's a lot to take in, and I have a ton of questions, but the one that I believe the others are hinged upon is this: 
  • The oortcloud guide suggested client/applications.js should be where the startup code is, but I find that index.js gets loaded before it, which puts my variable scope out-of-whack. I don't want to put all my code in index.js, so what's the logical thing to do? If I put Meteor.startup() in client/applications.js, will it load before index.js gets loaded? Or should I put startup code in /lib as per http://docs.meteor.com/#structuringyourapp?
Maybe my map will be updated correctly if I know exactly where the initial Template.map.rendered=... function needs to go? client/applications.js, or index.js? Thanks!

Gabriel Pugliese

unread,
Nov 18, 2013, 1:03:25 PM11/18/13
to meteo...@googlegroups.com
The oortcloud faq is very outdated :)

For code in around the meteor directories and folders, the load order is (as from the meteor docs):

  • Files in the lib directory at the root of your application are loaded first.

  • Files that match main.* are loaded after everything else.

  • Files in subdirectories are loaded before files in parent directories, so that files in the deepest subdirectory are loaded first (after lib), and files in the root directory are loaded last (other than main.*).

  • Within a directory, files are loaded in alphabetical order by filename.

    http://stackoverflow.com/questions/19142330/meteor-external-js-file-load-order-in-smart-package




Gabriel Pugliese
CodersTV.com
@coderstv


--
You received this message because you are subscribed to the Google Groups "meteor-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meteor-talk...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Robert Persaud

unread,
Nov 18, 2013, 1:44:25 PM11/18/13
to meteo...@googlegroups.com
Thanks for pointing out about the outdated unofficial faq, I'll recode the leaflet cluster using the meteor structure, and see how it goes! :)

Thomas Haferlach

unread,
Nov 18, 2013, 11:52:27 PM11/18/13
to meteo...@googlegroups.com
hey robert,

i'm currently working on an event map in meteor using leaflet and markercluster. i stumbled a little at the beginning but it all seems to be working pretty well now. i basically subscribe to the event collection which has longitude and latitude of the event markers to be rendered to the map. i resubscribe in a deps.autorun block whenever i pan and zoom the map to only render markers that are in the currently visible region.

i had to jump a few hoops to get dynamic popovers and marker icons rendered from templates.

adding and removing markers is all done in the cursor observe handlers. let me know if you have any more specific questions.

Matthew.forr

unread,
Nov 18, 2013, 11:52:51 PM11/18/13
to meteo...@googlegroups.com
Hi meteo...@googlegroups.com,

Thank you for contacting the pixelhacking Help Desk. We've received your request and will get back to you with a response as quickly as possible.

Cheers,

The pixelhacking Support Team

jean-guillaume lalanne

unread,
Mar 20, 2014, 7:54:02 AM3/20/14
to meteo...@googlegroups.com
Hello Thomas,

May you share an extract of your code ?

Best Regards,

Jeangui

Александр Подкидышев

unread,
Mar 20, 2014, 9:42:34 AM3/20/14
to meteo...@googlegroups.com
Hi
Maybe will be helpful

live: http://markercluster.meteor.com/

четверг, 20 марта 2014 г., 13:54:02 UTC+2 пользователь jean-guillaume lalanne написал:
Reply all
Reply to author
Forward
0 new messages