[ka-Map-users] customizing ka-map

Samuel Hiatt samhiatt at gmail.com
Tue Aug 7 14:47:54 EDT 2007


Ok... I got your code working...

All you need to do is add your kaMap object to the parameters of the
kaLegend call... so it should be:
 myKaLegend = new kaLegend( myKaMap, 'legend' );

kaLegend.js does say that all you need to do is add the name of the div, but
apparently it is wrong.  You gotta make sure to reference which map the
legend is for.

Take a look at the kaExplorer startUp.js (probably located at
/tools/kaExplorer/startUp.js)... it adds a legend with some additional
parameters that set the legend options.

Hope it works!

Sam


On 8/7/07, Alessio Di Lorenzo <alessio.dilorenzo at gmail.com> wrote:
>
>
> my code now is the following:
>
> <html>
>     <head>
>         <title>Customizing Ka-Map!</title>
>
>         <script type="text/javascript" src="DHTMLapi.js"></script>
>         <script type="text/javascript" src="xhr.js"></script>
>       <script type="text/javascript" src="kaMap.js"></script>
>         <script type="text/javascript" src="kaTool.js"></script>
>         <script type="text/javascript" src="kaLegend.js"></script>
>
>         <script type="text/javascript">
>                 var myKaMap;
>                 var myKaNav;
>
>                 function myOnLoad() {
>                     myKaMap = new kaMap( 'mapDiv' );
>                     myKaMap.server =
> 'http://localhost/luoghidabruzzo/ka-map/htdocs/';
>                     myKaMap.initialize();
>
>                         myNav = new kaNavigator ( myKaMap );
>                   myNav.activate ();
>
>                   myKaLegend = new kaLegend( 'legend' );
>
>                 }
>
>                 </script>
>
>     </head>
>     <body onload="myOnLoad();">
>
>                     <div id="mapDiv">
>                     </div>
>
>                     <div id="legend">legenda
>                     </div>
>
>     </body>
> </html>
>
> <style type="text/css">
>     #mapDiv {
>         position: relative;
>         width: 640px;
>         height: 480px;
>         background-color:  white;
>         border: 1px solid black;
>     }
> </style>
>
>
>
> If you try to use it, you get something working? (including the legend...)
>
>
> Alessio
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20070807/e44d45a5/attachment-0001.html


More information about the ka-Map-users mailing list