Skip to content
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

Add support for registering new protocol #9

Open
wants to merge 52 commits into
base: master
Choose a base branch
from

Conversation

tejaede
Copy link
Contributor

@tejaede tejaede commented Sep 21, 2021

Applications using montage-geo may need to support non-standard protocols. Fetching data for these protocols can be implemented by specializing feature-delegate and map-image-delegate. What's missing is a way for the map to identify whether a layer with a non-standard protocol is a feature layer or a tile layer.

For reference, the map categorizes layers using the following bindings:

            this.defineBinding("_tileLayers", {
                "<-":   "layers.filter{protocol.defined() && " +
                        "protocol.supportsTileImageRequests && " +
                        "(!protocol.supportsFeatureRequests || featureMinZoom > ^zoom)} ?? " +
                        "[]"
            });
            this.defineBinding("_featureLayers", {
                "<-":   "layers.filter{protocol.defined() && " +
                        "(!protocol.supportsTileImageRequests || " +
                        "(protocol.supportsFeatureRequests && featureMinZoom <= ^zoom))} ?? " +
                        "[]"
            });

https://github.com/montagejs/montage-geo/blob/features/contour/ui/map.reel/map.js#L26-L36

This commit adds a new class method to Protocol to create and register a new protocol with the necessary flags.

johnnykahalawai and others added 30 commits August 13, 2021 13:42
Allows the map to be stretched to fit a target DOM element
The static map will now automatically determine the appropriate zoom detail level based on the client devicePixelRatio. Consequently, the static map now accepts bounds instead of a center and zoom level.
Montage Geo extends the GeoJson specification by adding an additional
style property to feature.  If a feature has a style property it is
serialized into the GeoJson object and deserialized when read in.
The static map now draws features if the layer being drawn has a feature
collection property.
Remove reference to unused anchor
Icons are now positioned from their top left corner (like the HTML 5
canvas API) instead of its center.
The actual image of a MapImage may be smaller than the MapImage's size, e.g. when the image service returns a smaller image than what was specified due to exceeding max export size limits.
johnnykahalawai and others added 22 commits August 13, 2021 13:46
Layers are fetched through montage-data service by making a fetch for
Layer with a criteria that includes the Protocol and source URL.  Intern-
ally the layer service delegates the fetch to a child service special-
ized for that protocol.
- Set Protocol.ArcGIS.supportsFeatureRequests to true
- Fix the featureMinZoom flags in the map bindings determining what is a
  feature layer and what is a tile layer. featureMinZoom is the minimum
  zoom at which a layer can show features. This means a layer shall be
  a feature layer is the current map zoom is greater than or equal to
  the layer's featureMinZoom.
- Call super in constructor
- Update images on map move
Create a collection in FeatureCollectionOverlay if a
layer is assigned and store the fetched features in
that collection.
Logging for each symbol negatively affects
performance when removing a layer with
many features.
FeatureCollectionOverlay assumed that it had a map when it
received a collection. This commit allows the developer to
assign the collection to the overlay before it is added to the
map.
@tejaede tejaede self-assigned this Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants