legend

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

legend

Eduardo Zenaide
hi all,

how is the correct sintax for LEGEND? how is it used on the map file? is it a single element or included inside LAYER or other elements? i've found mapfile reference a little confusing.

thanks

--
Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

Re: legend

Gregor at HostGIS
> how is the correct sintax for LEGEND? how is it used on the map file?

The LEGEND block goes in the main block, not in a layer.

Here's an example, using a TrueType font, and embedded into the upper-left
corner of the map image.

LEGEND
  IMAGECOLOR 255 255 255
  KEYSIZE 12 12
  LABEL
    TYPE truetype
    FONT "Arial"
    SIZE 9
    COLOR 0 0 0
  END
  STATUS embed
  POSITION ul
END
Reply | Threaded
Open this post in threaded view
|

Re: legend

Eduardo Zenaide
thanks, Gregor.

one more thing about legend: how can i put it outside of the map. i have some layers with too many items for legend so the legend just don't appears. i thinks its because of the map size, it seems to block bigger legends :P
anyway, i've seen some examples using legend outside the map.


2006/12/18, Gregor Mosheh <[hidden email]>:
> how is the correct sintax for LEGEND? how is it used on the map file?

The LEGEND block goes in the main block, not in a layer.

Here's an example, using a TrueType font, and embedded into the upper-left
corner of the map image.

LEGEND
  IMAGECOLOR 255 255 255
  KEYSIZE 12 12
  LABEL
    TYPE truetype
    FONT "Arial"
    SIZE 9
    COLOR 0 0 0
  END
  STATUS embed
  POSITION ul
END






--
Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

Re: legend

Gregor at HostGIS
> one more thing about legend: how can i put it outside of the map.

Instead of setting the legend's status to "embed" set it to "on"
Then, in your HTML template, use the [legend] tag.
Reply | Threaded
Open this post in threaded view
|

Re: legend

Eduardo Zenaide
ok, i've seen the documentation but i really suck on cgi and don't figure out how to put it on the html.
the documentation refers to using <img src=[legend]> but it won't work here.

any help? please? :D


2006/12/19, Gregor Mosheh <[hidden email]>:
> one more thing about legend: how can i put it outside of the map.

Instead of setting the legend's status to "embed" set it to "on"
Then, in your HTML template, use the [legend] tag.






--
Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

Re: legend

Eduardo Zenaide
sure,

LEGEND
    KEYSIZE 11 7
#    LABEL
#        TYPE bitmap
#        SIZE 1
#        COLOR 0 0 89
#    END
    LABEL
        TYPE truetype
        FONT sans
        SIZE 7
        COLOR 0 0 0
    END
    STATUS on
    TEMPLATE "templates/legend.html"
END


2006/12/26, Dave Potts <[hidden email] >:
Eduardo Zenaide wrote:

> ok, i've seen the documentation but i really suck on cgi and don't
> figure out how to put it on the html.
> the documentation refers to using <img src=[legend]> but it won't work
> here.
>
> any help? please? :D
>
>
> 2006/12/19, Gregor Mosheh < [hidden email]
> <mailto:[hidden email]>>:
>
>     > one more thing about legend: how can i put it outside of the map.
>
>     Instead of setting the legend's status to "embed" set it to "on"
>     Then, in your HTML template, use the [legend] tag.
>
>
>
>
>
>
> --
> Eduardo Zenaide
HI
Have you inserted a legend request in the .map file ?
D.





--
Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

Re: legend

bthoen@gisnet.com
In reply to this post by Eduardo Zenaide
Eduardo Zenaide wrote:
> ok, i've seen the documentation but i really suck on cgi and don't
> figure out how to put it on the html.
> the documentation refers to using <img src=[legend]> but it won't work
> here.
>
> any help? please? :D
>
Eduardo,

Here's how you do this. In your map file within the MAP object
definition add a LEGEND object, like so:
LEGEND
  STATUS ON
END

And then in your html file where you want to display the legend add the
code:
<img src="[legend]" alt="Map Legend" />

Alternatively, you can create a link to it and it will pop up in a new
browser window. Just pu tthis in your html fiel where you want the link
to appear:

<a href="[legend]" target="_blank" />

HTH,
- Bill Thoen
Reply | Threaded
Open this post in threaded view
|

Re: legend

Eduardo Zenaide
hi, Bill,

i've done it all. the image simple don't appears.


2006/12/26, Bill Thoen <[hidden email]>:
Eduardo Zenaide wrote:
> ok, i've seen the documentation but i really suck on cgi and don't
> figure out how to put it on the html.
> the documentation refers to using <img src=[legend]> but it won't work
> here.
>
> any help? please? :D
>
Eduardo,

Here's how you do this. In your map file within the MAP object
definition add a LEGEND object, like so:
LEGEND
  STATUS ON
END

And then in your html file where you want to display the legend add the
code:
<img src="[legend]" alt="Map Legend" />

Alternatively, you can create a link to it and it will pop up in a new
browser window. Just pu tthis in your html fiel where you want the link
to appear:

<a href="[legend]" target="_blank" />

HTH,
- Bill Thoen




--
Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

Re: legend

bthoen@gisnet.com
What does your html file look like? Perhaps you've got a mismatched
bracket somewhere?

Eduardo Zenaide wrote:

> hi, Bill,
>
> i've done it all. the image simple don't appears.
>
>
> 2006/12/26, Bill Thoen <[hidden email] <mailto:[hidden email]>>:
>
>     Eduardo Zenaide wrote:
>     > ok, i've seen the documentation but i really suck on cgi and don't
>     > figure out how to put it on the html.
>     > the documentation refers to using <img src=[legend]> but it
>     won't work
>     > here.
>     >
>     > any help? please? :D
>     >
>     Eduardo,
>
>     Here's how you do this. In your map file within the MAP object
>     definition add a LEGEND object, like so:
>     LEGEND
>       STATUS ON
>     END
>
>     And then in your html file where you want to display the legend
>     add the
>     code:
>     <img src="[legend]" alt="Map Legend" />
>
>     Alternatively, you can create a link to it and it will pop up in a
>     new
>     browser window. Just pu tthis in your html fiel where you want the
>     link
>     to appear:
>
>     <a href="[legend]" target="_blank" />
>
>     HTH,
>     - Bill Thoen
>
>
>
>
> --
> Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

Re: legend

Perry Nacionales
In reply to this post by Eduardo Zenaide
You can find an answer here:
http://biometry.gis.umn.edu/tutorial/section2.html

-Perry

Eduardo Zenaide wrote:

> ok, i've seen the documentation but i really suck on cgi and don't
> figure out how to put it on the html.
> the documentation refers to using <img src=[legend]> but it won't work here.
>
> any help? please? :D
>
>
> 2006/12/19, Gregor Mosheh <[hidden email] <mailto:[hidden email]>>:
>
>      > one more thing about legend: how can i put it outside of the map.
>
>     Instead of setting the legend's status to "embed" set it to "on"
>     Then, in your HTML template, use the [legend] tag.
>
>
>
>
>
>
> --
> Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

avoid label collision in scalebar

Eijnden, Bart van den (AGI)
In reply to this post by Eduardo Zenaide
Hi list,
 
is there a way to avoid label collision in the scalebar?
 
Currently, when I zoom in very far, the labels overlap which makes the scalebar unreadable.
 
Is it possible to avoid this, if so does anybody have a set of SCALEBAR settings to share?
 
Thanks in advance.
 
Best regards,
Bart

Disclaimer ************************************************************************ Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te informeren. Wij adviseren u om bij twijfel over de juistheid of de volledigheid van de mail contact met afzender op te nemen. This message shall not constitute any rights or obligations. This message is intended solely for the addressee. If you have received this message in error, please delete it and notify the sender immediately. When in doubt whether this message is correct or complete, please contact the sender. ************************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: avoid label collision in scalebar

Steve Lime
Bart: There is no mechanism in place at the moment to avoid this. There
would be a couple of strategies
to employ in the C code, which one would depend on the nature of the
overlap (e.g. too many places vs.
to many intervals):

  - allow definition of a format string for labels
  - define a unit of measure hierarchy (e.g. km -> m -> cm)
  - automatically reduce the number of intervals if overlap is
detected

Just some ideas...

Steve
 

>>> "Eijnden, Bart van den (AGI)" <[hidden email]>
12/27/2006 9:47:12 AM >>>
Hi list,
 
is there a way to avoid label collision in the scalebar?
 
Currently, when I zoom in very far, the labels overlap which makes the
scalebar unreadable.
 
Is it possible to avoid this, if so does anybody have a set of SCALEBAR
settings to share?
 
Thanks in advance.
 
Best regards,
Bart



Disclaimer
************************************************************************
Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te
informeren. Wij adviseren u om bij twijfel over de juistheid of de
volledigheid van de mail contact met afzender op te nemen.

This message shall not constitute any rights or obligations.
This message is intended solely for the addressee.
If you have received this message in error, please delete it and
notify the sender immediately. When in doubt whether this message
is correct or complete, please contact the sender.
************************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: legend

Eduardo Zenaide
In reply to this post by Perry Nacionales
Bill, i'm positive the html is fine.

looking at Perry's tip i found that my form just don't have an action parameter. looks like i'm not using mapserver directly to parse the data, but the form send variables to other php file wich parse the data using functions.

since i'm working on GMap's functionality i wonder i'll have to create a function to show the legend, and this is my problem: i don't know how to create it.

so, i'll change my question :P

someone has a GMap based source using non-embeded legend?


--
Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

Re: avoid label collision in scalebar

Bart van den Eijnden (OSGIS)-2
In reply to this post by Steve Lime
For my use case only the third option would solve it. I have overlaps
when displaying 0.4 and 0.6 km for instance, so changing to meters will
make it worse, and the precision if as low as it goes.

But then again, I can just reduce the number of intervals for now I guess.

Thanks for the idea Steve, though some enhancement in this area would be
nice ofcourse :-)

Best regards,
Bart

Steve Lime schreef:

> Bart: There is no mechanism in place at the moment to avoid this. There
> would be a couple of strategies
> to employ in the C code, which one would depend on the nature of the
> overlap (e.g. too many places vs.
> to many intervals):
>
>   - allow definition of a format string for labels
>   - define a unit of measure hierarchy (e.g. km -> m -> cm)
>   - automatically reduce the number of intervals if overlap is
> detected
>
> Just some ideas...
>
> Steve
>  
>
>  
>>>> "Eijnden, Bart van den (AGI)" <[hidden email]>
>>>>        
> 12/27/2006 9:47:12 AM >>>
> Hi list,
>  
> is there a way to avoid label collision in the scalebar?
>  
> Currently, when I zoom in very far, the labels overlap which makes the
> scalebar unreadable.
>  
> Is it possible to avoid this, if so does anybody have a set of SCALEBAR
> settings to share?
>  
> Thanks in advance.
>  
> Best regards,
> Bart
>
>
>
> Disclaimer
> ************************************************************************
> Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
> uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
> hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te
> informeren. Wij adviseren u om bij twijfel over de juistheid of de
> volledigheid van de mail contact met afzender op te nemen.
>
> This message shall not constitute any rights or obligations.
> This message is intended solely for the addressee.
> If you have received this message in error, please delete it and
> notify the sender immediately. When in doubt whether this message
> is correct or complete, please contact the sender.
> ************************************************************************
>
>
>  


--
Bart van den Eijnden
OSGIS, Open Source GIS
[hidden email]
http://www.osgis.nl
Reply | Threaded
Open this post in threaded view
|

Re: avoid label collision in scalebar

Bart van den Eijnden (OSGIS)-2
Another option could be to just leave out some of the labels, for
instance if I have 5 intervals, just display 3 labels instead of 6. IMHO
that would be the best option.

Best regards,
Bart

Bart van den Eijnden (OSGIS) schreef:

> For my use case only the third option would solve it. I have overlaps
> when displaying 0.4 and 0.6 km for instance, so changing to meters
> will make it worse, and the precision if as low as it goes.
>
> But then again, I can just reduce the number of intervals for now I
> guess.
>
> Thanks for the idea Steve, though some enhancement in this area would
> be nice ofcourse :-)
>
> Best regards,
> Bart
>
> Steve Lime schreef:
>> Bart: There is no mechanism in place at the moment to avoid this. There
>> would be a couple of strategies
>> to employ in the C code, which one would depend on the nature of the
>> overlap (e.g. too many places vs.
>> to many intervals):
>>
>>   - allow definition of a format string for labels
>>   - define a unit of measure hierarchy (e.g. km -> m -> cm)
>>   - automatically reduce the number of intervals if overlap is
>> detected
>>
>> Just some ideas...
>>
>> Steve
>>  
>>  
>>>>> "Eijnden, Bart van den (AGI)" <[hidden email]>
>>>>>        
>> 12/27/2006 9:47:12 AM >>>
>> Hi list,
>>  
>> is there a way to avoid label collision in the scalebar?
>>  
>> Currently, when I zoom in very far, the labels overlap which makes the
>> scalebar unreadable.
>>  
>> Is it possible to avoid this, if so does anybody have a set of SCALEBAR
>> settings to share?
>>  
>> Thanks in advance.
>>  
>> Best regards,
>> Bart
>>
>>
>>
>> Disclaimer
>> ************************************************************************
>> Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
>> uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
>> hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te
>> informeren. Wij adviseren u om bij twijfel over de juistheid of de
>> volledigheid van de mail contact met afzender op te nemen.
>>
>> This message shall not constitute any rights or obligations.
>> This message is intended solely for the addressee.
>> If you have received this message in error, please delete it and
>> notify the sender immediately. When in doubt whether this message
>> is correct or complete, please contact the sender.
>> ************************************************************************
>>
>>
>>  
>
>


--
Bart van den Eijnden
OSGIS, Open Source GIS
[hidden email]
http://www.osgis.nl
Reply | Threaded
Open this post in threaded view
|

Re: legend

Eduardo Zenaide
In reply to this post by Eduardo Zenaide
just to be a bit more annoying...


i'm trying to use non-embeded legend on GMap application.
since GMap uses specified functions to draw its maps, there's a function to draw the legend?


--
Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

Re: legend

Eduardo Zenaide
ok, closing the thread i'm posting the solution i've made for non-embedded legend for GMap based applications. nothing new, it's all based on GMapDrawKeyMap().:

this goes on inc.php file (as gmap75.inc.php ):

function GMapDrawLegend(){
    GLOBAL $gpoMap;
    GLOBAL $gAppletImgFmt, $gImagesFmt;
   
    $img = $gpoMap->drawLegend();
    $url = $img->saveWebImage($gImagesFmt, 0, 0, -1);
   
    printf("<b>Legend:</b><br/><br/><input type=image src=$url name=legend />");
}

and it goes on template file (as gmap75.phtml):

<?php GMapDrawLegend() ?>


hope someone use it :)
well, i'm using...


--
Eduardo Zenaide