-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix API and Update maptunik to be able to receive incoming independen…
…t style (#15) * Add upload API * Fix pagination * Fix order * Update maptunik to be able to receive incoming style
- Loading branch information
Showing
9 changed files
with
217 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# coding=utf-8 | ||
"""Cloud Native GIS.""" | ||
|
||
from rest_framework.pagination import PageNumberPagination | ||
from rest_framework.response import Response | ||
|
||
|
||
class Pagination(PageNumberPagination): | ||
"""Pagination for API.""" | ||
|
||
page_size_query_param = 'page_size' | ||
|
||
def get_paginated_response_data(self, data): | ||
"""Return paginated only data.""" | ||
return { | ||
'next': self.get_next_link(), | ||
'previous': self.get_previous_link(), | ||
'count': self.page.paginator.count, | ||
'page': self.page.number, | ||
'total_page': self.page.paginator.num_pages, | ||
'page_size': self.page.paginator.per_page, | ||
'results': data, | ||
} | ||
|
||
def get_paginated_response(self, data): | ||
"""Response for pagination.""" | ||
return Response(self.get_paginated_response_data(data)) |
27 changes: 27 additions & 0 deletions
27
django_project/cloud_native_gis/serializer/layer_upload.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# coding=utf-8 | ||
""" | ||
GeoSight is UNICEF's geospatial web-based business intelligence platform. | ||
Contact : [email protected] | ||
.. note:: This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation; either version 3 of the License, or | ||
(at your option) any later version. | ||
""" | ||
__author__ = '[email protected]' | ||
__date__ = '23/07/2024' | ||
__copyright__ = ('Copyright 2023, Unicef') | ||
|
||
from rest_framework import serializers | ||
|
||
from cloud_native_gis.models.layer_upload import LayerUpload | ||
|
||
|
||
class LayerUploadSerializer(serializers.ModelSerializer): | ||
"""Serializer for LayerUpload.""" | ||
|
||
class Meta: # noqa: D106 | ||
model = LayerUpload | ||
exclude = () |
202 changes: 101 additions & 101 deletions
202
...static/cloud_native_gis/index-DRZ64yjZ.js → ...static/cloud_native_gis/index-CHkHdgsP.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ic/cloud_native_gis/index-DRZ64yjZ.js.map → ...ic/cloud_native_gis/index-CHkHdgsP.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule maputnik
updated
4 files
+6 −0 | index.html | |
+24 −1 | src/components/AppToolbar.tsx | |
+58 −1 | src/components/CloudNativeGIS/Main.tsx | |
+2 −22 | src/components/CloudNativeGIS/Style.tsx |