[mapguide-users] mapguide-rest feedback

Jackie Ng jumpinjackie at gmail.com
Wed Oct 29 04:29:41 PDT 2014


Hi Mark,

Responses inline:

>> Issues/tweaks I've had to make to the responses (pretty much all are just 
>> string operations in php  code) 
>> Calls to get the current list layers for the map; 
>> 1) would be nice if it include the link to generate the legend icon 
>> 2) would be nice if it also returned the sub styles as well as the layers 

[JN]: This URL route

/session/:sessionId/:mapName.Map/layers.:format

Actually supports the following additional optional parameters:

 * requestedfeatures - A bitmask indicating what optional data to include
with the layers (2 = Include Feature Source info, 4 = Include styles/icons)
 * iconformat - The icon image format. Only applicable if requestedfeatures
has 4 logically-ORed in
 * iconwidth - The width of generated icons. Only applicable if
requestedfeatures has 4 logically-ORed in
 * iconheight - The height of generated icons. Only applicable if
requestedfeatures has 4 logically-ORed in
 * iconsperscalerange - The number of icons to generate per scale range.
Only applicable if requestedfeatures has 4 logically-ORed in
 * group - The group name to filter layers by

The reason you probably don't know about this is because I forgot to
document these optional parameters so they don't appear in the interactive
REST API documentation.

I've made a new github issue for this:
https://github.com/jumpinjackie/mapguide-rest/issues/77

>> Calls against the current selection set; 
>> 1) would be nice if it returned only the fields that have been
>> set/selected 
>> for the layer ("layer properties visible in viewer" section in maestro) 
>> rather than all fields. 

[JN]: You can pass a mappedonly=1 parameter to the selected features route:

/session/:sessionId/:mapName.Selection/features.:format/:layerName

To only respect the property mappings of the layer definition

>> 2) a  variable (true/false) whether the geometry records should be
>> returned. 

[JN]: Passing mappedonly=1 to the request will already achieve this as
geometry properties never show up in the property mappings of a Layer
Definition and thus are omitted when mappedonly=1. Unless you are after a
"give me everything but the geometry" type result, it would be simpler for
all parties involved to just use the property mappings of the Layer
Definition to drive the behaviour.

>> And one extra really, really nice tool would be a utility that created a 
>> smarty template for KML by reading a layer definition. 

[JN]: This is a problem that someone else will have to solve :) The main
problem of KML output (if we're not wrapping existing KML service
functionality) is around the issue of thematic layers. We can't really
dynamically generate KML content with appropriate translated styles from a
Layer Definition because the MapGuide API itself lacks the means of
evaluating filters against a feature (ie. Does this feature match this rule
in the Layer Definition?).

These problems surfaced when we added CZML support. We've hacked a workable
solution for CZML output, but that has its own pitfalls:

 * We do x feature queries for x number of rules in the Layer Definition, we
build PHP closures over the parsed Layer Definition so it knows what styles
to generate for a given feature.
 * We skip over the default style rule to avoid re-processing features
already covered by the above style rules. This naturally presents problems
for features that do not satisfy any of the above style rules. There's no
workaround for that. 
 * Don't get me started on Advanced Stylization :) We don't support such
layers and we ain't going there now or in the future.

This is just to get rudimentary CZML output that somewhat retains visual
fidelity from the Layer Definition. I am saying all of this because if we
want KML output in mapguide-rest, I am strongly in favour of wrapping
existing services/APIs already in MapGuide in a RESTful manner instead of
reinventing the wheel and having to go through so many hoops like I did to
get basic CZML output support.

So for KML smarty templates, this is some of the pitfalls you have to be
aware of if you're going to be writing an automated tool to generate such
templates.

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/mapguide-rest-feedback-tp5168657p5170146.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list