Code Monkey home page Code Monkey logo

Comments (5)

grantlucas avatar grantlucas commented on August 15, 2024

There's a whole host of map options that aren't supported yet by this directive. It would probably be a good thing to add the ability to set general map options on the directive within the scope.

A possible way to conform to how the directive is already setup would be

<leaflet options="options"></leaflet>

Then in the controller

$scope.options = {
    scrollWheelZoom: false,
    zoomControl: false,
    <etc>
};

Within the directive it would be good to pass on as much of this generically as possible to Leaflet. Would help prevent this directive from becoming too big of a middle man. The directive shouldn't be hand mapping each option into the Leaflet map as when there are updates to Leaflet, this directive requires an update.

I'm sure I'll be wanting some of these options in the coming weeks as well so if no one has tackled it by then, I can give it a shot.

from angular-leaflet-directive.

carloc avatar carloc commented on August 15, 2024

That @grantlucas is a wonderful solution! I hope someone is able to implement it...I don't understand angular directives too well to be able to do it myself, though. :(

from angular-leaflet-directive.

tombatossals avatar tombatossals commented on August 15, 2024

Hi, I have implemented the scrollWheelZoom property inside the actual directive. You can use a similar solution like the proposed by @grantlucas, but we use the "defaults" property to group all these initial options.

You could use the directive passing it the "default" property:

<leaflet defaults="defaults"></leaflet>

Previously, you have to extend the scope on the controller like this:

$scope.defaults = {
     scrollWheelZoom: false
}

You can see a demo of this here:
http://tombatossals.github.io/angular-leaflet-directive/examples/custom-parameters-example.html

from angular-leaflet-directive.

carloc avatar carloc commented on August 15, 2024

@tombatossals you are the MAN!! :D Thank you very very much!!!

from angular-leaflet-directive.

carloc avatar carloc commented on August 15, 2024

@tombatossals this commit seems to have created errors in my code, though: see #89

I don't know if these can be caused by the update or not, and they seem to have no effect...

from angular-leaflet-directive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.