kopia lustrzana https://github.com/openstreetmap-polska/aed-mapa
Refactoring python, js code, icon collection
rodzic
05e2319bb2
commit
1b4c5ea2a3
101
download_data.py
101
download_data.py
|
@ -18,18 +18,16 @@ logger.setLevel(logging.INFO)
|
|||
overpass_api_url = "https://lz4.overpass-api.de/api/interpreter"
|
||||
|
||||
overpass_query = """
|
||||
[out:json][timeout:90];
|
||||
// area(3600049715) = Polska
|
||||
area(3600049715)->.searchArea;
|
||||
// gather results
|
||||
(
|
||||
// query part for: “emergency=defibrillator”
|
||||
node[emergency=defibrillator](area.searchArea);
|
||||
);
|
||||
// print results
|
||||
out body;
|
||||
>;
|
||||
out skel qt;"""
|
||||
[out:json]
|
||||
[timeout:90];
|
||||
area(3600049715)->.searchArea; // Polska
|
||||
(
|
||||
node[emergency=defibrillator](area.searchArea);
|
||||
);
|
||||
out body;
|
||||
>;
|
||||
out skel qt;
|
||||
"""
|
||||
|
||||
tag_name_mapping = {
|
||||
"defibrillator:location": "lokalizacja (osm_tag:defibrillator:location)",
|
||||
|
@ -71,8 +69,8 @@ def geojson_point_feature(lat: float, lon: float, properties: Dict[str, str]) ->
|
|||
}
|
||||
|
||||
|
||||
def elements_from_overpass_api(api_url: str, query: str) -> List[dict]:
|
||||
logger.info(f"Requesting data from: {api_url}")
|
||||
def get_elements_from_overpass_api(api_url: str, query: str) -> List[dict]:
|
||||
logger.info(f"Requesting data from Overpass API. [url={api_url}]")
|
||||
try:
|
||||
response = requests.post(url=api_url, data={"data": query})
|
||||
response.raise_for_status()
|
||||
|
@ -83,25 +81,25 @@ def elements_from_overpass_api(api_url: str, query: str) -> List[dict]:
|
|||
|
||||
|
||||
def save_json(file_path: Union[str, Path], data: dict) -> None:
|
||||
logger.info(f"Saving file: {file_path}...")
|
||||
logger.info(f"Saving .json file. [path={file_path}]")
|
||||
with open(file=file_path, mode="w", encoding="utf-8") as f:
|
||||
json.dump(data, f, allow_nan=False)
|
||||
logger.info(f"Done saving file: {file_path}.")
|
||||
logger.info("Done saving .json file.")
|
||||
|
||||
|
||||
def save_csv(file_path: Union[str, Path], data: List[dict], columns: List[str]) -> None:
|
||||
logger.info(f"Saving file: {file_path}...")
|
||||
logger.info(f"Saving .csv file. [path={file_path}]")
|
||||
with open(file=file_path, mode="w", encoding="utf-8") as f:
|
||||
csv_writer = csv.DictWriter(f, fieldnames=columns)
|
||||
csv_writer.writeheader()
|
||||
csv_writer.writerows(data)
|
||||
logger.info(f"Done saving file: {file_path}.")
|
||||
logger.info("Done saving .csv file.")
|
||||
|
||||
|
||||
def save_spreadsheet(file_path: str, data: Dict[str, list]) -> None:
|
||||
logger.info(f"Saving file: {file_path}...")
|
||||
logger.info(f"Saving .ods file. [path:{file_path}]")
|
||||
pyexcel_ods3.save_data(file_path, data)
|
||||
logger.info(f"Done saving file: {file_path}.")
|
||||
logger.info("Done saving .ods file.")
|
||||
|
||||
|
||||
def load_geocoding_cache(file_path: Union[str, Path]) -> Dict[str, str]:
|
||||
|
@ -126,7 +124,7 @@ def main_overpass(
|
|||
|
||||
ts = datetime.now(tz=timezone.utc).replace(microsecond=0)
|
||||
# call Overpass API
|
||||
elements = elements_from_overpass_api(
|
||||
elements = get_elements_from_overpass_api(
|
||||
api_url=overpass_api_url, query=overpass_query
|
||||
)
|
||||
|
||||
|
@ -158,7 +156,9 @@ def main_overpass(
|
|||
for key, value in element["tags"].items()
|
||||
if key in tags_to_keep
|
||||
}
|
||||
|
||||
geojson_properties = {"osm_id": osm_id, **tags}
|
||||
|
||||
csv_attributes = {
|
||||
"osm_id": str(osm_id),
|
||||
"latitude": str(latitude),
|
||||
|
@ -206,16 +206,16 @@ def main_overpass(
|
|||
[str(ts.isoformat()), number_of_rows],
|
||||
]
|
||||
|
||||
if number_of_rows > 0:
|
||||
logger.info(f"Prepared data to save. Number of rows: {number_of_rows}")
|
||||
if number_of_rows == 0:
|
||||
logger.error("Empty dataset, nothing to write. [number_of_rows=0]")
|
||||
else:
|
||||
logger.info(f"Data prepared to save. [number_of_rows={number_of_rows}]")
|
||||
save_json(file_path=geojson_file_path, data=geojson)
|
||||
save_csv(file_path=csv_file_path, data=csv_row_list, columns=sorted_csv_columns)
|
||||
save_spreadsheet(
|
||||
file_path=spreadsheet_file_path.as_posix(), data=spreadsheet_template
|
||||
)
|
||||
save_json(file_path=json_metadata_file_path, data=json_metadata)
|
||||
else:
|
||||
logger.error("Nothing to write.")
|
||||
|
||||
|
||||
def main_google_sheets(output_dir: Path, config_files_dir: Path) -> None:
|
||||
|
@ -226,31 +226,36 @@ def main_google_sheets(output_dir: Path, config_files_dir: Path) -> None:
|
|||
|
||||
custom_layer_file_path = output_dir.joinpath("custom_layer.geojson")
|
||||
geojson = deepcopy(geojson_template)
|
||||
gsheets_url = open(config_path, "r").read()
|
||||
|
||||
logger.info("Reading Google Sheets credentials.")
|
||||
gc = gspread.service_account(filename=sa_credentials_json_path)
|
||||
logger.info("Opening Google Sheets url.")
|
||||
gsheet = gc.open_by_url(gsheets_url)
|
||||
data = gsheet.worksheet("dane_raw").get_all_records()
|
||||
logger.info(f"Reading rows from Google Sheets. Rows to process: {len(data)}.")
|
||||
counter = 0
|
||||
for row in data:
|
||||
if (
|
||||
all([row["latitude"], row["longitude"]])
|
||||
and row.get("import", "UNKNOWN") == "FALSE"
|
||||
):
|
||||
geojson["features"].append(
|
||||
geojson_point_feature(
|
||||
lat=row["latitude"],
|
||||
lon=row["longitude"],
|
||||
properties={"type": row.get("typ")},
|
||||
)
|
||||
try:
|
||||
with open(config_path, "r").read() as gsheets_url:
|
||||
logger.info("Reading Google Sheets credentials.")
|
||||
gc = gspread.service_account(filename=sa_credentials_json_path)
|
||||
logger.info("Opening Google Sheets url.")
|
||||
gsheet = gc.open_by_url(gsheets_url)
|
||||
data = gsheet.worksheet("dane_raw").get_all_records()
|
||||
logger.info(
|
||||
f"Reading rows from Google Sheets. Rows to process: {len(data)}."
|
||||
)
|
||||
counter += 1
|
||||
logger.info(f"{counter} features to export.")
|
||||
if len(geojson["features"]) > 0:
|
||||
save_json(file_path=custom_layer_file_path.as_posix(), data=geojson)
|
||||
counter = 0
|
||||
for row in data:
|
||||
if (
|
||||
all([row["latitude"], row["longitude"]])
|
||||
and row.get("import", "UNKNOWN") == "FALSE"
|
||||
):
|
||||
geojson["features"].append(
|
||||
geojson_point_feature(
|
||||
lat=row["latitude"],
|
||||
lon=row["longitude"],
|
||||
properties={"type": row.get("typ")},
|
||||
)
|
||||
)
|
||||
counter += 1
|
||||
logger.info(f"{counter} features to export.")
|
||||
if len(geojson["features"]) > 0:
|
||||
save_json(file_path=custom_layer_file_path.as_posix(), data=geojson)
|
||||
except FileNotFoundError:
|
||||
logger.error(f"Config file not found. [config_path={config_path}]")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 35 KiB |
|
@ -0,0 +1,305 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="240"
|
||||
height="240"
|
||||
viewBox="0 0 63.499999 63.500002"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
inkscape:version="1.0rc1 (09960d6f05, 2020-04-09)"
|
||||
sodipodi:docname="markers_collection.svg">
|
||||
<defs
|
||||
id="defs2" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.18463586"
|
||||
inkscape:cx="2458.7674"
|
||||
inkscape:cy="-993.33426"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
inkscape:document-rotation="0"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
inkscape:snap-page="true"
|
||||
inkscape:window-width="2134"
|
||||
inkscape:window-height="1198"
|
||||
inkscape:window-x="123"
|
||||
inkscape:window-y="58"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Warstwa 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
inkscape:export-ydpi="44.351269"
|
||||
inkscape:export-xdpi="44.351269"
|
||||
id="g911"
|
||||
transform="matrix(0.31728341,0,0,0.30446264,-37.329044,48.059331)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="M 128.83989,5.9689433 V 214.53312 H 329.5582 l 10e-6,-208.5641767 z"
|
||||
id="path2421"
|
||||
style="fill:#009140;fill-opacity:1;stroke:none;stroke-width:0.215962" />
|
||||
<g
|
||||
id="g904">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 180.16118,67.104956 c -20.78208,0.190752 -39.30043,20.758612 -33.72333,47.974104 4.25146,20.7465 26.34438,47.72564 64.88549,73.87681 38.54111,-26.15117 60.63403,-53.13031 64.88549,-73.87681 5.5771,-27.215492 -12.94125,-47.783352 -33.72333,-47.974104 -10.68087,-0.163774 -24.04125,5.482921 -31.16216,19.123583 -7.12091,-13.640662 -20.48129,-19.287357 -31.16216,-19.123583 z"
|
||||
id="path2830"
|
||||
style="fill:#ffffff;stroke:none;stroke-width:0.263878" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 195.90696,74.635486 -7.07407,74.826384 25.12573,-18.11621 -4.33174,33.40847 -7.80701,-2.74137 9.31406,21.70807 15.62226,-17.36481 h -7.80701 l 13.26697,-60.0213 -30.11628,21.79891 7.97995,-37.173738 -1.67176,-3.203778 c -3.14968,-6.033466 -7.63747,-10.315452 -12.5011,-13.120628 z"
|
||||
id="path3611"
|
||||
style="fill:#009140;fill-opacity:1;stroke:none;stroke-width:0.263878" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 283.52996,16.364706 v 17.174893 h -17.12931 v 17.174894 h 17.12931 v 17.174893 h 17.1293 V 50.714493 h 17.12931 V 33.539599 H 300.65926 V 16.364706 Z"
|
||||
id="rect3634"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.263878" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="g911-1"
|
||||
transform="matrix(0.31728341,0,0,0.30446264,-37.329047,111.55933)"
|
||||
inkscape:export-xdpi="44.351269"
|
||||
inkscape:export-ydpi="44.351269">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="M 128.83989,5.9689433 V 214.53312 H 329.5582 l 10e-6,-208.5641767 z"
|
||||
id="path2421-0"
|
||||
style="fill:#ffc100;fill-opacity:1;stroke:none;stroke-width:0.215962" />
|
||||
<g
|
||||
id="g904-9">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 180.16118,67.104956 c -20.78208,0.190752 -39.30043,20.758612 -33.72333,47.974104 4.25146,20.7465 26.34438,47.72564 64.88549,73.87681 38.54111,-26.15117 60.63403,-53.13031 64.88549,-73.87681 5.5771,-27.215492 -12.94125,-47.783352 -33.72333,-47.974104 -10.68087,-0.163774 -24.04125,5.482921 -31.16216,19.123583 -7.12091,-13.640662 -20.48129,-19.287357 -31.16216,-19.123583 z"
|
||||
id="path2830-9"
|
||||
style="fill:#ffffff;stroke:none;stroke-width:0.263878" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 195.90696,74.635486 -7.07407,74.826384 25.12573,-18.11621 -4.33174,33.40847 -7.80701,-2.74137 9.31406,21.70807 15.62226,-17.36481 h -7.80701 l 13.26697,-60.0213 -30.11628,21.79891 7.97995,-37.173738 -1.67176,-3.203778 c -3.14968,-6.033466 -7.63747,-10.315452 -12.5011,-13.120628 z"
|
||||
id="path3611-0"
|
||||
style="fill:#ffc100;fill-opacity:1;stroke:none;stroke-width:0.263878" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 283.52996,16.364706 v 17.174893 h -17.12931 v 17.174894 h 17.12931 v 17.174893 h 17.1293 V 50.714493 h 17.12931 V 33.539599 H 300.65926 V 16.364706 Z"
|
||||
id="rect3634-9"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.263878" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
inkscape:export-ydpi="44.351269"
|
||||
inkscape:export-xdpi="44.351269"
|
||||
id="g911-3"
|
||||
transform="matrix(0.31728341,0,0,0.30446264,-37.329041,-15.440668)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="M 128.83989,5.9689433 V 214.53312 H 329.5582 l 10e-6,-208.5641767 z"
|
||||
id="path2421-7"
|
||||
style="fill:#3e83d0;fill-opacity:1;stroke:none;stroke-width:0.215962" />
|
||||
<g
|
||||
id="g904-94">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 180.16118,67.104956 c -20.78208,0.190752 -39.30043,20.758612 -33.72333,47.974104 4.25146,20.7465 26.34438,47.72564 64.88549,73.87681 38.54111,-26.15117 60.63403,-53.13031 64.88549,-73.87681 5.5771,-27.215492 -12.94125,-47.783352 -33.72333,-47.974104 -10.68087,-0.163774 -24.04125,5.482921 -31.16216,19.123583 -7.12091,-13.640662 -20.48129,-19.287357 -31.16216,-19.123583 z"
|
||||
id="path2830-7"
|
||||
style="fill:#ffffff;stroke:none;stroke-width:0.263878" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 195.90696,74.635486 -7.07407,74.826384 25.12573,-18.11621 -4.33174,33.40847 -7.80701,-2.74137 9.31406,21.70807 15.62226,-17.36481 h -7.80701 l 13.26697,-60.0213 -30.11628,21.79891 7.97995,-37.173738 -1.67176,-3.203778 c -3.14968,-6.033466 -7.63747,-10.315452 -12.5011,-13.120628 z"
|
||||
id="path3611-9"
|
||||
style="fill:#3e83d0;fill-opacity:1;stroke:none;stroke-width:0.263878" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 283.52996,16.364706 v 17.174893 h -17.12931 v 17.174894 h 17.12931 v 17.174893 h 17.1293 V 50.714493 h 17.12931 V 33.539599 H 300.65926 V 16.364706 Z"
|
||||
id="rect3634-4"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.263878" />
|
||||
</g>
|
||||
</g>
|
||||
<text
|
||||
inkscape:export-ydpi="44.351269"
|
||||
inkscape:export-xdpi="44.351269"
|
||||
transform="scale(1.0660781,0.93801759)"
|
||||
id="text884"
|
||||
y="29.886772"
|
||||
x="71.560883"
|
||||
style="font-style:normal;font-weight:normal;font-size:25.5611px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.639028"
|
||||
xml:space="preserve"><tspan
|
||||
style="stroke-width:0.639028"
|
||||
y="29.886772"
|
||||
x="71.560883"
|
||||
id="tspan882"
|
||||
sodipodi:role="line">PRIVATE/OTHER</tspan></text>
|
||||
<text
|
||||
inkscape:export-ydpi="44.351269"
|
||||
inkscape:export-xdpi="44.351269"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:25.5611px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.639027"
|
||||
x="73.768013"
|
||||
y="96.644188"
|
||||
id="text884-5"
|
||||
transform="scale(1.0660781,0.93801759)"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan882-0"
|
||||
x="73.768013"
|
||||
y="96.644188"
|
||||
style="stroke-width:0.639027">YES</tspan></text>
|
||||
<text
|
||||
inkscape:export-ydpi="44.351269"
|
||||
inkscape:export-xdpi="44.351269"
|
||||
transform="scale(1.0660781,0.93801759)"
|
||||
id="text884-5-7"
|
||||
y="164.30304"
|
||||
x="71.79332"
|
||||
style="font-style:normal;font-weight:normal;font-size:25.5611px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.639027"
|
||||
xml:space="preserve"><tspan
|
||||
style="stroke-width:0.639027"
|
||||
y="164.30304"
|
||||
x="71.79332"
|
||||
id="tspan882-0-0"
|
||||
sodipodi:role="line">CUSTOMERS</tspan></text>
|
||||
<text
|
||||
inkscape:export-ydpi="44.351269"
|
||||
inkscape:export-xdpi="44.351269"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:25.5611px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.639027"
|
||||
x="71.511421"
|
||||
y="-98.327507"
|
||||
id="text884-1"
|
||||
transform="scale(1.0660781,0.93801759)"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan882-5"
|
||||
x="71.511421"
|
||||
y="-98.327507"
|
||||
style="font-weight:bold;stroke-width:0.639027">ACCESS</tspan></text>
|
||||
<g
|
||||
transform="matrix(0.31728341,0,0,0.30446263,-37.329038,-78.940666)"
|
||||
id="g911-3-6"
|
||||
inkscape:export-xdpi="44.351269"
|
||||
inkscape:export-ydpi="44.351269">
|
||||
<path
|
||||
style="fill:#7a7a7a;fill-opacity:1;stroke:none;stroke-width:0.215962"
|
||||
id="path2421-7-4"
|
||||
d="M 128.83989,5.9689433 V 214.53312 H 329.5582 l 10e-6,-208.5641767 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<g
|
||||
id="g904-94-3">
|
||||
<path
|
||||
style="fill:#ffffff;stroke:none;stroke-width:0.263878"
|
||||
id="path2830-7-3"
|
||||
d="m 180.16118,67.104956 c -20.78208,0.190752 -39.30043,20.758612 -33.72333,47.974104 4.25146,20.7465 26.34438,47.72564 64.88549,73.87681 38.54111,-26.15117 60.63403,-53.13031 64.88549,-73.87681 5.5771,-27.215492 -12.94125,-47.783352 -33.72333,-47.974104 -10.68087,-0.163774 -24.04125,5.482921 -31.16216,19.123583 -7.12091,-13.640662 -20.48129,-19.287357 -31.16216,-19.123583 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#7a7a7a;fill-opacity:1;stroke:none;stroke-width:0.263878"
|
||||
id="path3611-9-3"
|
||||
d="m 195.90696,74.635486 -7.07407,74.826384 25.12573,-18.11621 -4.33174,33.40847 -7.80701,-2.74137 9.31406,21.70807 15.62226,-17.36481 h -7.80701 l 13.26697,-60.0213 -30.11628,21.79891 7.97995,-37.173738 -1.67176,-3.203778 c -3.14968,-6.033466 -7.63747,-10.315452 -12.5011,-13.120628 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.263878"
|
||||
id="rect3634-4-3"
|
||||
d="m 283.52996,16.364706 v 17.174893 h -17.12931 v 17.174894 h 17.12931 v 17.174893 h 17.1293 V 50.714493 h 17.12931 V 33.539599 H 300.65926 V 16.364706 Z"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
<text
|
||||
transform="scale(1.0660781,0.93801759)"
|
||||
id="text884-5-1"
|
||||
y="-37.157387"
|
||||
x="72.651192"
|
||||
style="font-style:normal;font-weight:normal;font-size:25.5611px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.639027"
|
||||
xml:space="preserve"
|
||||
inkscape:export-xdpi="44.351269"
|
||||
inkscape:export-ydpi="44.351269"><tspan
|
||||
style="stroke-width:0.639027;font-style:italic"
|
||||
y="-37.157387"
|
||||
x="72.651192"
|
||||
id="tspan882-0-5"
|
||||
sodipodi:role="line">EMPTY</tspan></text>
|
||||
<g
|
||||
inkscape:export-ydpi="44.351269"
|
||||
inkscape:export-xdpi="44.351269"
|
||||
transform="matrix(0.31728341,0,0,0.30446263,-37.32905,175.05933)"
|
||||
id="g911-1-3">
|
||||
<path
|
||||
style="fill:#3e83d0;fill-opacity:1;stroke:none;stroke-width:0.215962"
|
||||
id="path2421-0-9"
|
||||
d="M 128.83989,5.9689433 V 214.53312 H 329.5582 l 10e-6,-208.5641767 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<g
|
||||
id="g904-9-2">
|
||||
<path
|
||||
style="fill:#ffffff;stroke:none;stroke-width:0.243576"
|
||||
id="path2830-9-5"
|
||||
d="m 171.21577,30.074419 c -19.14525,0.176425 -36.20506,19.199465 -31.06722,44.370847 3.9166,19.188266 24.26945,44.141044 59.775,68.328034 35.50555,-24.18699 55.85839,-49.139768 59.775,-68.328034 5.13784,-25.171382 -11.92198,-44.194422 -31.06723,-44.370847 -9.83962,-0.151473 -22.14772,5.071108 -28.70777,17.68724 -6.56006,-12.616132 -18.86815,-17.838713 -28.70778,-17.68724 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#3e83d0;fill-opacity:1;stroke:none;stroke-width:0.243576"
|
||||
id="path3611-0-6"
|
||||
d="m 185.72139,37.039343 -6.51691,69.206297 23.14679,-16.755528 -3.99057,30.899208 -7.19211,-2.53547 8.58047,20.07761 14.39182,-16.06057 h -7.19212 l 12.22205,-55.513195 -27.74428,20.161639 7.35144,-34.381687 -1.54009,-2.963147 c -2.90161,-5.580301 -7.03593,-9.540674 -11.51649,-12.135157 z"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.219923"
|
||||
id="rect3634-9-7"
|
||||
d="M 286.45745,16.364706 V 30.488833 H 271.9895 v 14.124128 h 14.46795 V 58.737088 H 300.9254 V 44.612961 h 14.46795 V 30.488833 H 300.9254 V 16.364706 Z"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
inkscape:export-ydpi="44"
|
||||
inkscape:export-xdpi="44"
|
||||
style="fill:#ffffff;fill-opacity:1"
|
||||
transform="matrix(0.16538642,0,0,0.18004519,7.6776561,162.47291)"
|
||||
id="g1008">
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
inkscape:connector-curvature="0"
|
||||
stroke-linejoin="miter"
|
||||
d="m 244.67888,270.81639 c -9.05993,0.004 -18.08824,0.0149 -18.08824,0.0149 l -22.25845,0.31354 c -8.41261,-0.28768 -15.65655,2.34534 -20.12722,11.79519 l -16.15734,39.04399 c -11.761,3.13424 -16.87477,11.39571 -17.14572,18.17098 v 51.15205 h 15.50843 v 17.2151 c -0.7516,16.40596 27.07386,17.06173 27.69588,-0.14931 l 0.32438,-16.90173 h 100.62029 l 0.32156,16.89613 c 0.62202,17.21102 28.44758,16.55525 27.69588,0.1493 v -17.2151 h 15.49315 v -51.15206 c -0.27126,-6.77475 -5.38473,-15.03633 -17.14573,-18.17097 l -16.15734,-39.04402 c -4.47066,-9.4498 -11.69879,-12.08307 -20.1114,-11.79519 l -22.25845,-0.31355 c -0.0711,-0.0179 -9.15218,-0.0194 -18.21159,-0.0149 z m -38.49327,13.88581 c 0.70362,-0.003 1.42576,0.0153 2.17798,0.0448 l 72.98767,0.22396 c 6.67937,-0.15063 9.51696,-0.0124 12.35719,6.09199 l 11.63133,30.2943 -121.05748,-0.16424 11.49216,-29.45817 c 1.79227,-5.89938 5.48541,-7.00608 10.41099,-7.03258 z m -25.42496,51.79406 c 7.23814,0 13.11416,5.665 13.11416,12.6614 0,6.9964 -5.87602,12.67617 -13.11416,12.67617 -7.23815,0 -13.09888,-5.67977 -13.09888,-12.67617 0,-6.9964 5.86073,-12.6614 13.09888,-12.6614 z m 128.66935,0 c 7.23815,0 13.11417,5.665 13.11417,12.6614 0,6.9964 -5.87602,12.67617 -13.11417,12.67617 -7.23814,0 -13.09888,-5.67977 -13.09888,-12.67617 0,-6.9964 5.86074,-12.6614 13.09888,-12.6614 z"
|
||||
fill-rule="evenodd"
|
||||
stroke="#000000"
|
||||
stroke-linecap="butt"
|
||||
stroke-miterlimit="4"
|
||||
stroke-width="1.03652"
|
||||
fill="#000000"
|
||||
id="path998" />
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:25.5611px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.639027"
|
||||
x="72.618195"
|
||||
y="232.91438"
|
||||
id="text884-5-7-6"
|
||||
transform="scale(1.0660781,0.93801759)"
|
||||
inkscape:export-xdpi="44.351269"
|
||||
inkscape:export-ydpi="44.351269"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan882-0-0-6"
|
||||
x="72.618195"
|
||||
y="232.91438"
|
||||
style="stroke-width:0.639027">MOBILE</tspan></text>
|
||||
</g>
|
||||
</svg>
|
Po Szerokość: | Wysokość: | Rozmiar: 16 KiB |
18
src/map.js
18
src/map.js
|
@ -1,5 +1,5 @@
|
|||
const aedSource = './aed_poland.geojson';
|
||||
const customLayerSource= './custom_layer.geojson';
|
||||
const customLayerSource = './custom_layer.geojson';
|
||||
const aedMetadata = './aed_poland_metadata.json';
|
||||
const controlsLocation = 'bottom-right';
|
||||
let aedNumberElements = [
|
||||
|
@ -75,11 +75,11 @@ var map = new maplibregl.Map({
|
|||
'text-size': 20,
|
||||
'text-letter-spacing': 0.05,
|
||||
'text-overlap': 'always',
|
||||
},
|
||||
},
|
||||
'paint': {
|
||||
'text-color': '#f5f5f5',
|
||||
},
|
||||
'filter': ['has', 'point_count'],
|
||||
'text-color': '#f5f5f5',
|
||||
},
|
||||
'filter': ['has', 'point_count'],
|
||||
}, ],
|
||||
},
|
||||
});
|
||||
|
@ -152,7 +152,7 @@ console.log('Loading icon...');
|
|||
|
||||
map.loadImage('./src/img/marker-image-yes.png', (error, image) => {
|
||||
if (error) throw error;
|
||||
|
||||
|
||||
map.addImage('aed-icon-yes', image, {
|
||||
'sdf': false
|
||||
});
|
||||
|
@ -160,7 +160,7 @@ map.loadImage('./src/img/marker-image-yes.png', (error, image) => {
|
|||
|
||||
map.loadImage('./src/img/marker-image-private.png', (error, image) => {
|
||||
if (error) throw error;
|
||||
|
||||
|
||||
map.addImage('aed-icon-private', image, {
|
||||
'sdf': false
|
||||
});
|
||||
|
@ -171,7 +171,7 @@ map.loadImage('./src/img/marker-image-private.png', (error, image) => {
|
|||
|
||||
map.loadImage('./src/img/marker-image-customers.png', (error, image) => {
|
||||
if (error) throw error;
|
||||
|
||||
|
||||
map.addImage('aed-icon-customers', image, {
|
||||
'sdf': false
|
||||
});
|
||||
|
@ -286,4 +286,4 @@ function toggleCustomLayer() {
|
|||
'filter': ['==', 'type', 'mobile'],
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Ładowanie…
Reference in New Issue