mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 11:52:38 +02:00
Merge pull request #2035 from umap-project/fix-georss
fix: fix georss import
This commit is contained in:
commit
3c5d3e09ba
3 changed files with 41 additions and 1 deletions
|
@ -106,7 +106,7 @@ export class Formatter {
|
|||
}
|
||||
|
||||
async fromGeoRSS(str) {
|
||||
return GeoRSSToGeoJSON(this.toDom(c))
|
||||
return GeoRSSToGeoJSON(this.toDom(str))
|
||||
}
|
||||
|
||||
toDom(x) {
|
||||
|
|
20
umap/tests/fixtures/test_upload_georss.xml
vendored
Normal file
20
umap/tests/fixtures/test_upload_georss.xml
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:creativeCommons="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:flickr="urn:flickr:user" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:georss="http://www.georss.org/georss" xmlns:media="http://search.yahoo.com/mrss/" xmlns:woe="http://where.yahooapis.com/v1/schema.rng">
|
||||
<channel>
|
||||
<title>Test stream</title>
|
||||
<link>http://www.pouet.fr/link/</link>
|
||||
<description/>
|
||||
<pubDate>Sun, 13 Apr 2014 09:20:36 -0700</pubDate>
|
||||
<lastBuildDate>Sun, 13 Apr 2014 09:20:36 -0700</lastBuildDate>
|
||||
<generator>http://www.pouet.com/</generator>
|
||||
<item>
|
||||
<title>Title 1</title>
|
||||
<link>http://link.com</link>
|
||||
<description>Description 1</description>
|
||||
<pubDate>Sun, 13 Apr 2014 09:20:36 -0700</pubDate>
|
||||
<geo:lat>53.443324</geo:lat>
|
||||
<geo:long>-2.218337</geo:long>
|
||||
<enclosure url="http://farm4.staticflickr.com/3758/13906321891_faa9be0b8e_b.jpg" type="image/jpeg" />
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
|
@ -607,3 +607,23 @@ def test_import_osm_relation(tilelayer, live_server, page):
|
|||
# A layer and one path has been created
|
||||
expect(layers).to_have_count(1)
|
||||
expect(paths).to_have_count(1)
|
||||
|
||||
|
||||
def test_import_georss_from_textarea(tilelayer, live_server, page):
|
||||
page.goto(f"{live_server.url}/map/new/")
|
||||
page.get_by_title("Open browser").click()
|
||||
layers = page.locator(".umap-browser .datalayer")
|
||||
markers = page.locator(".leaflet-marker-icon")
|
||||
expect(markers).to_have_count(0)
|
||||
expect(layers).to_have_count(0)
|
||||
button = page.get_by_title("Import data")
|
||||
expect(button).to_be_visible()
|
||||
button.click()
|
||||
textarea = page.locator(".umap-upload textarea")
|
||||
path = Path(__file__).parent.parent / "fixtures/test_upload_georss.xml"
|
||||
textarea.fill(path.read_text())
|
||||
page.locator('select[name="format"]').select_option("georss")
|
||||
page.get_by_role("button", name="Import data", exact=True).click()
|
||||
# A layer has been created
|
||||
expect(layers).to_have_count(1)
|
||||
expect(markers).to_have_count(1)
|
||||
|
|
Loading…
Reference in a new issue