Git Product home page Git Product logo

Comments (4)

VLunaa avatar VLunaa commented on August 23, 2024

These errors are displayed on the console.
imagen

from django-map-widgets.

erdem avatar erdem commented on August 23, 2024

The issue may be related to the jQuery version that you used. I have used 2.x jquery while I am developing the widgets.

Take a look at the demo project to see if that helps.

https://github.com/erdem/django-map-widgets/tree/master/demo/

from django-map-widgets.

VLunaa avatar VLunaa commented on August 23, 2024

The issue may be related to the jQuery version that you used. I have used 2.x jquery while I am developing the widgets.

Take a look at the demo project to see if that helps.

https://github.com/erdem/django-map-widgets/tree/master/demo/

Thanks, it's working now. Do you know any way to make the map zoom move with the scroll?
How can I modify the map template, the size of the form and the buttons?

Thanks for this great job, by the way.

from django-map-widgets.

erdem avatar erdem commented on August 23, 2024

@VLunaa

I disabled the scroll wheel zooming functionality during the initial development, it was messing up the actual page scrolling when the mouse cursor came over the map component. It was so a long time ago, didn't notice that settings were hardcoded until reading your last message.

However, I just released the new version which includes scrollWheel settings. Upgrade the PyPI package in your stack and set scrollWheel as True in the django settings.

You are welcome!

settings.py

GOOGLE_MAP_API_KEY = os.getenv('GOOGLE_MAP_API_KEY', None)
MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', None)
MAP_WIDGETS = {
    "GooglePointFieldWidget": (
        ("zoom", 15),
        ("mapCenterLocation", [51.5073509, -0.12775829999998223]),
        ("markerFitZoom", 11),
        ("GooglePlaceAutocompleteOptions", {'componentRestrictions': {'country': 'uk'}}),
        ("streetViewControl", False),
        ("scrollWheel", True)
    ),
    "MapboxPointFieldWidget": {
        "access_token": MAPBOX_API_KEY,
        "mapOptions": {
            "zoom": 10,
            "center": (51.515618, -0.091998)
        }
    },
    "GOOGLE_MAP_API_KEY": GOOGLE_MAP_API_KEY
}

from django-map-widgets.

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.