Hello I am new and building an application in Flask and Javascript. I have a problem with sending data from Flask do JavaScript. I have code in routes.py I want to send jsonify(slownik) to my code in JavaScript but I dont want to do it with render_template bacause it refresh a page and I need this data to display it
Tag: leaflet
How to fix error “Failed to compile : ./node_modules/@react-leaflet/core/esm/path.js 10:41 Module parse failed: Unexpected token (10:41)”
I am trying to create a react-typescript app along with leaflet. I used the command, npm install leaflet react-leaflet @types/react @types/leaflet –save to install the dependencies. But when I start the application it says, Here’s my package.json Here’s map/index.tsx I tried reinstalling dependencies several times but still didn’t work. I understand this is a simple issue and an error that
Leaflet createTile await for image to load
I am using the createTile with Vue2Leaflet library to make custom tiles. As far as I saw in the documentation, the function runs as many times as there are coords on the map. In my case, the function is triggered way more times than I have images to return so at the end I get 90%+ empty tiles that just
Uncaught TypeError: L.minichart is not a function (Leaflet Piechart)
I tried to create my chart using leaflet and caught an error that say L.minichart is not a function. And here is my script : Answer You have not imported the library. Include it inside the head tag after importing leaftet css and js:
How to get borders for the react-leaflet map and check markers inside the map?
My code is here: My question is, how can I use bbox to check if some of my markers is inside the map? When I try to apply: or this: I faced the error: bbox is not defined I don’t know how to return bbox from function LocationMarker(). I would be grateful for any help. Thank you. Answer You need
Using existing lat/lng leaflet markers in separate AJAX function / API call
I have a leaflet map with markers showing the top cities in a chosen country. When a marker is clicked, the lat/lng of that city is used in an AJAX call and a modal displaying weather information for the city pops up through use of a PHP cURL routine to a weather API. A couple of easyButtons appear after this
Dynamically inserting latitude/longitude from array to weather API call in PHP
I have a leaflet map which has markers displaying the top 10 cities in a country depending on what country is chosen from a select field. $latLng contains 10 latitude/longitude pairs and is being used to add each city at that location onto the map. Example in console (Australia): The locationList array is stringified and used as data for the
Get Leaflet pop up to only show when feature properties are not null
I have GeoJSON data that contains URLs. Not all of the features have url data. I have a pop up which shows the name and a link to the url. I’d like to be able to only show the link to URL when the feature URL is not null but will always show the name as a minimum. My code
React leaflet map center not changing
I’m setting up a map to find the coords of a person and then put that location on the map. But for some reason, the coords aren’t being shown on the map. I console.log to make sure the state variables(where the coords are being stored) were emitting the right coords and they are. I don’t know why the map won’t
How to Set Leaflet Map’s Zoom to Show All Markers in React Leaflet?
I have a React Leaflet map that needs to change its center and zoom when given a set of markers. The zoom should be changed such that all the markers are visible. This change of view is currently being attempted using the function ChangeView. Using my code below, I am able to move the map view, but not able to