-
Notifications
You must be signed in to change notification settings - Fork 46
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
Support custom layer to Maps #150
Support custom layer to Maps #150
Conversation
maps_dashboards/public/components/layer_control_panel/layer_control_panel.tsx
Outdated
Show resolved
Hide resolved
7666e9c
to
88122ed
Compare
maps_dashboards/public/components/layer_config/custom_map_config/custom_map_source.tsx
Outdated
Show resolved
Hide resolved
|
||
const [customMapURL, setCustomMapURL] = useState<string>(''); | ||
const [customMapAttribution, setCustomMapAttribution] = useState<string>(''); | ||
const [protocol, setProtocol] = useState(customMapProtocolOptions[0].value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
Should we keep WMS as default? just for legacy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, updated.
921263c
to
69027a3
Compare
new URL(url); | ||
return false; | ||
} catch (e) { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we include error message from exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<EuiForm> | ||
<EuiFlexGrid columns={1}> | ||
<EuiFlexItem> | ||
<EuiFormLabel>Protocol</EuiFormLabel> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking about calling it as "Custom type" . WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, updated
export const referenceLayerTypeLookup = { | ||
[DASHBOARDS_MAPS_LAYER_TYPE.OPENSEARCH_MAP]: true, | ||
[DASHBOARDS_MAPS_LAYER_TYPE.CUSTOM_MAP]: true, | ||
[DASHBOARDS_MAPS_LAYER_TYPE.DOCUMENTS]: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not include this as property of Specification?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WMS from Coordinate maps looks like below, Shall we keep same fields/description?
Leaflet is using L.tileLayer.wms
to constructs the right WMS call from it's parameters and then forwards it to WMS server
var wmsLayer = L.tileLayer.wms('http://ows.mundialis.de/services/service?', {
layers: 'TOPO-OSM-WMS'
}).addTo(map);
but in maplibre(example), it doesn't have this kind of api call, we need explicitly pass parameters to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it is not possible to abstract those extra parameters similar to leaflet, will go with what we have. Shall we mark what is required and optional as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just updated, also added the help text to each parameter
Signed-off-by: Junqiu Lei <[email protected]>
Signed-off-by: Junqiu Lei <[email protected]>
Signed-off-by: Junqiu Lei <[email protected]>
Signed-off-by: Junqiu Lei <[email protected]>
Signed-off-by: Junqiu Lei <[email protected]>
b24353d
to
74733ee
Compare
Signed-off-by: Junqiu Lei <[email protected]>
74733ee
to
3412124
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks
Signed-off-by: Junqiu Lei [email protected]
Description
Support custom layer to Maps.
Allow user to add TMS protocol and WMS protocol type raster tile to Maps. On this type of layer, user can select protocol type, add/update source under Data tab and basic layer setting under Setting tab like name, zoom range, opacity and description.
Demo
update_demo_1.mov
Issues Resolved
#149
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.