[ZS0] Re: [mapguide-users] [ZS0] drawing customized markers on the fly

Kenneth, GEOGRAF A/S ks at geograf.dk
Thu Feb 28 07:02:32 EST 2008


I understood from your original post that you wanted a tooltip with 
different icons.
If that is the case, you can just modify the tooltip.

If you want different symbols displayed in the map, you must create a 
theme (or display rules) in the layer.
The easiest way to accomplish this, is to create an extra column, say 
"symboltype".
The modify the layer to show different symbols based on the "symboltype" 
column.

I would recomend that you create a featuresource with sample data, and 
the create the layer in Studio.
Once you have the layer, you can copy it to the session repo, and modify 
the FeatureSource property to point to the temp source.
Alternatively, you can save it to an Xml file, and use the approach 
outlined in the buffer example.

Regards, Kenneth, GEOGRAF A/S



Kencana skrev:
> Hi Kenneth,
>
> Thanks for your reply. I have try it but some how i can't display 2 marker
> with 2 different icon in the same layer. 
> unless i create different class definition
>
> $classDefinition = new MgClassDefinition();
> $classDefinition->SetName("Points");
> $classDefinition->SetDescription("Feature class with point data.");
> $classDefinition->SetDefaultGeometryPropertyName("GEOM");
>
> with different name and all...
>
> Any idea?
>
> Thank you
>
> Regards,
> Kencana Kesuma
>
>
> Kenneth, GEOGRAF A/S wrote:
>   
>> Yes, it is possible, but a few steps are involved:
>>
>> 1. Create a temporary featuresource
>> 2. Create a temporary layer to display the features
>> 3. Insert the temporary layer into the runtime map
>>
>> The buffer files in the MapGuide viewer has template code for all three 
>> steps.
>> All steps are explained in the Developer Guide (PDF version at least).
>>
>> The icon and url are columns in the feature source, and you can select 
>> them when you insert the marker.
>>
>> Regards, Kenneth, GEOGRAF A/S
>>
>>
>>
>> Kencana skrev:
>>     
>>> Hi All,
>>>
>>> I've been trying to this for quite some time. Is that possible for us to
>>> create multiple markers with different icon and url source (displayed
>>> under
>>> tooltip) in one single php function (one layer) on the fly?
>>> Let's say there are 3 marker, what i want to do is i want to place 3
>>> different marker on the fly.
>>> I've been posting this issue in previous post but it seems there is no
>>> solution given yet.
>>>
>>> Regards,
>>> Kencana
>>>   
>>>       
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>
>>
>>     
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20080228/bfdbc36b/attachment.html


More information about the mapguide-users mailing list