javascript - How to use Angular JS with Leaflet.js -


i working on dashboard using node.js/leaflet.js. started learning angular js few weeks ago. @ medium step in project.

i building interactive map dashboard using:

  • node.js/express.js process data on backend
  • leaflet.js map visualization
  • other libraries d3.js.

now, trying add widgets dashboard, click on points , fetch information related each point db using node.js.

i'd simplify problem , consider example. http:jsfiddle.net/8qhfe/128/

when hover mouse on shape, chart related every polygon/point on map.

i confused! question is:

  • should re-create app embed leaflet angular js code, example link or use angular leaflet directive. read not stable library yet.
  • is best choice use angular.js in such scenarios?

so great question. struggle understanding how implement mapping packages angular. the plunker below shows 1 way of doing it, not sure "angular way". love hear other people weigh in.

in last mapping application did not use angularleaflet because had many customization do. (for example turn wms layers on , off depending upon variables, swap basemaps on zoom levels, use esri layers, etc). said looks great project , forward using it.

plunker example

i have 1 controller map , 2 services.

  1. mapctrl (controller logic map)
  2. mapservice talk local storage , save last view better ux
  3. recordservice ajax data show on map

so angular best choice?

who knows, regardless enjoy using angular cannot see reason not too. toughest thing way show not being able use angular 2-way binding in popups. though countered being able heavily customize map without forking angularleaflet project... (maybe lazy).

let me know think?


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -