Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use leaflet with with custom floormap #258

Open
rob-vandam opened this issue Jul 27, 2019 · 1 comment
Open

Use leaflet with with custom floormap #258

rob-vandam opened this issue Jul 27, 2019 · 1 comment

Comments

@rob-vandam
Copy link

rob-vandam commented Jul 27, 2019

I took me a while to figure out how. Perhaps an idea to add this option to the docs?
I have a jpg image of a floormap with size in px: 3673x2781

My settings.py:

LEAFLET_CONFIG = {
    'TILES': [],
    'LAYERS':[],
    'SPATIAL_EXTENT': (0, 0, 3673,2781)
}

templates/shared/leaflet_widget_overlays.js:

<script type="text/javascript">
  window.addEventListener("map:init", function (event) {
    var map = event.detail.map; // Get reference to map
    map.options.crs = L.CRS.Simple;
    map.options.minZoom = -2;
    var bounds = [[0,0], [2781,3673]];
    var image = L.imageOverlay('/static/plattegrond.jpg', bounds).addTo(map);
    map.fitBounds(bounds);
    
});
</script>
@eowusu14
Copy link

eowusu14 commented Dec 17, 2022

I'm facing this issue. I have added a png of a map as a tile but is it is grided.
Django version is 3.2

Kindly help me resolve it. Thank you
admin interface

@rob-vandam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants