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

Frontend marker not the same as the marker being shown on the admin site #264

Open
kevinopix opened this issue Nov 7, 2019 · 4 comments

Comments

@kevinopix
Copy link

So after i have done everything right, and its all working good, on displaying the map on the front-end, this is the HTML code i used
{% load leaflet_tags %}
{% leaflet_css %}
{% leaflet_js %}

{{ building.osm_id }}

{% leaflet_map "main" callback="map_init" %}
<script type="text/javascript"> function map_init(map, options) { // get point lat and lon var lon = "{{ building.geometry.x }}"; var lat = "{{ building.geometry.y }}"; // zoom to point & add it to map map.setView([lat, lon], 5); L.marker([lat, lon]).addTo(map); } </script>

This produces a marker like it is supposed to, and this is the marker i am talking about

Screenshot from 2019-11-07 14-12-04

Now my issue is that this marker is not the same as the marker that is shown in the admin side, which i am interested in. Check out the marker on the admin side
Note the number at the top is the osm_id which should be the same as the number being displayed on top of the frontend
Screenshot from 2019-11-07 14-16-55

Kindly check this issue out and any help on this project would be much appreciated.

@Gagaro
Copy link
Member

Gagaro commented Nov 7, 2019

You inverted geometry.x and geometry.y.

@kevinopix
Copy link
Author

kevinopix commented Nov 7, 2019 via email

@kevinopix
Copy link
Author

What baffles me is that what is being displayed on the admin site is correct but what is on the frontend isn't. Is there a way of checking what is being displayed on the admin site. If i can have a look at the code which is used to get the values in the admin site i think i can be able to replicate that with the HTML file that shows the front-end
This might sound dumb but do you know how to access the code/file which produces the admin site HTML?

@kevinopix
Copy link
Author

I figured it out. Thank you though

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