Дарю: набор статей,
демонстрирующих построение JavaScript
веб-карты не простой а
золотой
использующей слабосвязанные компоненты,
конфигурирование (параметризацию) через
URL и прочие интересные
фишки. Концептуально.
“Marionette Maps”
is an on-going series on building a loosely coupled, configuration
driven map viewer using Marionette.js.
Read Part
1, Part
2, Part
3, Part
4 and Part
5.
...
Lessons Learned
I learned a couple
conceptual level things along the way which I’ll be sure to plan
for moving forward. Here they are in no particular order…
Make a List of
Events
This app is right at
the edge of something that you can keep in your head easily. Moving
forward, I’ll be keeping a list of the events and a description of
what they are supposed to do in the project.
Plan your Routes
Plan ahead for how
you are going to handle the router, and holding the context of the
map in the url. When I first added the router, I just stored the
center of the map and the zoom level, which was easy to tie into
things as the map is all cleanly separated, and it’s easy to raise
events from the map and use that to update the url. Adding in the
“Year” was troublesome in that the value of the year is set as a
result of selecting a historical year to view. Ok, not too bad for
updating the url via Router.navigate, but parsing out the values and
correctly restoring the map state was more complex than I’d have
liked.
Data Consistency
This also came up at
the end. I had planned to show another “window” with details
about a wildfire, which would be relatively simple – EXCEPT – the
attributes for the current fires layer are DIFFERENT from those on
the historical fire layers, which borked things up royally as all the
rest of the code assumes that all the wildfire layers are the same.
This certainly could be worked around, but since no one is paying for
this app, I let it ride with a mouse-over that shows the fire name. I
have some ideas about how to harvest all the data into a consistent
format, hosted on ArcGIS Server 10.1 and then use some of the new
Stats options to show interesting info about the data, but that will
have to wait for a while.
Если тема
интересна, лучше всего начать с предисловия
разъясняющего
тему «нафига козе
боян зачем нам
Backbone.Marionette»
original post http://vasnake.blogspot.com/2013/07/displaying-wildfires.html
Комментариев нет:
Отправить комментарий