[mapguide-internals] Selection is slower than expected

Kenneth, GEOGRAF A/S ks at geograf.dk
Wed Sep 5 09:19:55 EDT 2007


The transparency for PNG's are already in heavy use in the viewer, so I 
don't consider that a problem.

Testing a bit here and there reveals that it is actually possible to 
tweak the server into making the desired image.
Here are the steps to achieve it:

1. Select the item(s)
2. Create a copy of the current map (runtime or mapdefinition)
3. Set the alpha value of the background color to 0 (transparent).
4. Turn of all layers
5. Render the image

The returned image will now contain only the overlay, and is transparent.
This image can be displayed on top of the map.

This means that it is possible to tweak the current viewer to support 
it, but overhead of creating/maintaining a duplicate map are undesired.
I think it should be implemented as a "GETDYNAMICOVERLAYSELECTION" 
operation.
The implementation should be pretty straightforward, using the existing 
rendering engine, but skipping the redering of the actual layers.
Perhaps it is easier to use an "SELECTIONONLY" parameter in the 
GETDYNAMICOVERLAYIMAGE function call?

My test shows that the original map occupies arround 350kb and takes 
app. 1.2 seconds, where the transparent selection only occupies 7 kb and 
takes 300 ms.
This makes the entire "selection experience" a lot more attractive.

I will add this as a feature request.

Regards, Kenneth, GEOGRAF A/S



Paul Spencer skrev:
> Kenneth,
>
> this is probably a good idea.  I think it would need to use a PNG24 
> with alpha channel so that the selection image doesn't obscure things, 
> but this raises potential problems (for which there are known hacks) 
> for Internet Explorer.  If we forgo transparency in the actual 
> selected area, then it may work without hacks - but then you would 
> lose anti-aliasing of the selection polygon.
>
> The GETDYNAMICOVERLAYMAP operation already produces something with 
> transparency for overlaying on tiles.  A similar operation could be 
> created, GETDYNAMICOVERLAYSELECTION perhaps, that just draws the 
> selection.  I would hope that would be fairly straightforward - 
> although I don't think you can do it with the web tier scripting APIs 
> as is.
>
> I guess this is what the DWF viewer has an advantage over the AJAX 
> viewer - client side selection.
>
> Cheers
>
> Paul
>
> On 5-Sep-07, at 3:33 AM, Kenneth, GEOGRAF A/S wrote:
>
>> When selecting items in map, a full new map image is generated.
>> This requires rendereing the entire map, and then transfering the 
>> entire map to the client.
>>
>> Has anyone tried to implement the selection as a transparent png, 
>> containing only the selected graphics (overlay image)?
>> This procedure is potentially very fast to render, and certainly has 
>> a much smaller size.
>>
>> Are there any issues that would obstruct such an implementation?
>>
>> -- 
>> Regards, Kenneth, GEOGRAF A/S
>>
>>
>> _______________________________________________
>> mapguide-internals mailing list
>> mapguide-internals at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-internals
>
> +-----------------------------------------------------------------+
> |Paul Spencer                          pspencer at dmsolutions.ca    |
> +-----------------------------------------------------------------+
> |Chief Technology Officer                                         |
> |DM Solutions Group Inc                http://www.dmsolutions.ca/ |
> +-----------------------------------------------------------------+
>
>
>
>
>
> _______________________________________________
> mapguide-internals mailing list
> mapguide-internals at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-internals


More information about the mapguide-internals mailing list