Changes between Version 8 and Version 9 of MapGuideRfc126
- Timestamp:
- 05/06/13 03:49:25 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MapGuideRfc126
v8 v9 290 290 }}} 291 291 292 Inline selection images are rendered out as inline base64 string, inside the <Content> element of the <InlineSelectionImage> element, avoiding an additional GETDYNAMICMAPOVERLAYIMAGE request. This exploits the new Data URI feature supported by most modern browsers, the AJAX and Fusion viewers can do the capability checks client-side to determine whether to request an inline selection. Attributes of all features are grouped by their respective layer name. 292 Inline selection images are rendered out as inline base64 string, inside the <Content> element of the <InlineSelectionImage> element, avoiding an additional GETDYNAMICMAPOVERLAYIMAGE request. This exploits the new Data URI feature supported by most modern browsers, the AJAX and Fusion viewers can do the capability checks client-side to determine whether to request an inline selection. Attributes of all features are grouped by their respective layer name. 293 293 294 294 The inline image does not have the mime-type prepended to the string. It is included as a separate <MimeType> element of the <InlineSelectionImage> element. Browsers that can support data URIs can assemble the final data URI from these components. Non-browser clients should be able to have the necessary means to process the base64 content based on the given <MimeType> value. … … 300 300 The AJAX viewer will need some slight modifications to deal with the new QUERYMAPFEATURES response as the structure differs from what is returned by getselectedfeatures.[php/jsp/aspx], but the content is the same. Selected features can be grouped by layer name and each individual selected feature has a bounding box for the "Zoom to current feature" function to work. If data URIs are supported, the viewer needs to simply check the content of the {{{InlineSelectionImage}}} property in the response. If it is not empty, it can be assigned straight into the {{{<img>}}} element that holds the selection image, otherwise we proceeed as normal and send off a GETDYNAMICMAPOVERLAYIMAGE request for that image. With the implementation of this RFC, getselectedfeatures.[php/jsp/ajax] will no longer be required and can be removed. 301 301 302 Because we have the bounding box of individual features client-side, we gain an additional benefit by eliminating a GETFEATURESETENVELOPE request for the "Zoom to Selection" command, as we can instead compute the aggregate bounding box based on the bounding boxes of our selected features and use that instead for calculating the desired zoom level/location. 302 Because we have the bounding box of individual features client-side, we gain an additional benefit by eliminating a GETFEATURESETENVELOPE request for the "Zoom to Selection" command, as we can instead compute the aggregate bounding box based on the bounding boxes of our selected features and use that instead for calculating the desired zoom level/location. In fact, the AJAX viewer will get new APIs to access this new information: 303 304 {{{ 305 306 function GetSelectedBounds() 307 Returns the bounding box of the selected features. Returns null if no features are selected. The box is a Bounds object: 308 309 Bounds { 310 minx; /* The min x coordinate of this bounding box */ 311 miny; /* The min y coordinate of this bounding box */ 312 maxx; /* The max x coordinate of this bounding box */ 313 maxy; /* The max y coordinate of this bounding box */ 314 } 315 316 function GetSelectedFeatures() 317 Returns the selection set including attributes of selected features. The selection set is structured like so: 318 319 { 320 layerName1 : [ 321 { //feature 1 in layerName1 322 values: [ 323 { name: "attribute1", value: "value1" }, 324 { name: "attribute2", value: "value2" }, 325 { name: "attribute3", value: "value3" }, 326 ... 327 { name: "attributeN", value: "valueN" } 328 ] 329 zoom: { minx: <feature1_bbox_minx>, miny: <feature1_bbox_miny>, maxx: <feature1_bbox_maxx>, maxy: <feature1_bbox_maxy> } 330 }, 331 { //feature 2 in layerName1 332 values: [ 333 { name: "attribute1", value: "value1" }, 334 { name: "attribute2", value: "value2" }, 335 { name: "attribute3", value: "value3" }, 336 ... 337 { name: "attributeN", value: "valueN" } 338 ] 339 zoom: { minx: <feature2_bbox_minx>, miny: <feature2_bbox_miny>, maxx: <feature2_bbox_maxx>, maxy: <feature2_bbox_maxy> } 340 }, 341 ..., 342 { //feature N in layerName1 343 values: [ 344 { name: "attribute1", value: "value1" }, 345 { name: "attribute2", value: "value2" }, 346 { name: "attribute3", value: "value3" }, 347 ... 348 { name: "attributeN", value: "valueN" } 349 ] 350 zoom: { minx: <featureN_bbox_minx>, miny: <featureN_bbox_miny>, maxx: <featureN_bbox_maxx>, maxy: <featureN_bbox_maxy> } 351 } 352 ], layerName2 : [ 353 ... 354 ], 355 ..., 356 layerNameN : [ 357 ... 358 ] 359 } 360 361 362 363 }}} 303 364 304 365 For Fusion, it gets a bit more complicated as it makes various calls to assorted PHP scripts (SaveSelection.php, GetSelectionProperties.php, etc). This asynchronous call chain of PHP scripts needs to be refactored so that it only needs to send the new QUERYMAPFEATURES request and process its response as it does all the things that these PHP scripts were previously needed for. In addition, it's client-side selection structure is radically different from that of the AJAX viewer. Given the very early stage of this RFC, discussion with Fusion developers is needed to determine if the sample responses proposed here is enough to replicate the existing client-side selection model and this RFC will be updated accordingly based on developer feedback.