FW: [ka-Map-users] Drawing routes in ka-map

jochen at IngenieurTeam2.com jochen at IngenieurTeam2.com
Tue Oct 4 09:16:49 EDT 2005


Hello Jeremy,

Look at the code below, in the variable s I have a WKT polygon definition.
The coordinates are in the same system like the map file.
You have to add the following  to your html file at the appropriate
positions.
  <html xmlns:vml="urn:schemas-microsoft-com:vml">
  
  <OBJECT id="VMLRender"
classid="CLSID:10072CEC-8CC1-11D1-986E-00A0C955B42E" 
  </OBJECT>
  
  <style>
	vml\:* { behavior: url(#VMLRender) }
  </style>

The problem is I can't get rid of them when I want to remove the drawing
canvas.
Hope this helps, excuse my english

Best regards,
Jochen

//function

this.canvas = this.kaMap.createDrawingCanvas( 500 );

 var s = "40.12094 31.26751, 40.33459 40.28502, 63.60432 39.79871, 63.5729
38.29527, 63.63422 38.27346, 63.69408 38.2479, 63.75223 38.21868, 63.80847
38.18591, 63.86256 38.14972, 63.91431 38.11024, 63.96352 38.06764, 64.00999
38.02207, 64.05355 37.97371, 64.09402 37.92274, 64.13127 37.86936, 64.16513
37.81378, 64.19548 37.7562, 64.22221 37.69686, 64.24521 37.63597, 64.2644
37.57378, 64.27969 37.51052, 64.29104 37.44643, 64.29839 37.38176, 64.30172
37.31676, 64.30102 37.25167, 64.29629 37.18676, 64.28754 37.12226, 64.27482
37.05843, 64.25816 36.99552, 64.23764 36.93375, 64.21334 36.87337, 64.18533
36.81462, 64.15374 36.75771, 64.11869 36.70287, 64.08031 36.65031, 64.03874
36.60023, 63.99415 36.55281, 63.94671 36.50826, 63.89659 36.46672, 63.84401
36.42837, 63.78914 36.39336, 63.73221 36.36181, 63.67344 36.33384, 63.61305
36.30958, 63.55127 36.2891, 63.48834 36.27249, 63.4245 36.25981, 63.36
36.2511, 63.29508 36.24641, 63.23 36.24576, 63.22478 35.99581, 63.52471
35.98954, 63.41585 30.78068, 40.12094 31.26751";  var a = s.split (new
RegExp("\\s*,\\s*|\\s+"  ));  var b = [];  var p;  for (var i = 0; i <
a.length; i += 2)  {
  p = this.kaMap.geoToPix (a[i], a[i+1]);
  p[0] = p[0] - this.kaMap.xOrigin;
  p[1] = p[1] - this.kaMap.yOrigin;
  b.push (p[0]);
  b.push (p[1]);
 }

 var o = document.createElement ("vml:polyline");  o.filled=true;
o.stroked=false;  o.fillcolor= "red";  o.points= b.toString ();
this.canvas.appendChild(o); 


-----Original Message-----
From: Jeremy Malczyk [mailto:jeremy at trails.com]
Sent: Dienstag, 4. Oktober 2005 02:43
To: ka-map-users at lists.maptools.org
Subject: Re: [ka-Map-users] Drawing routes in ka-map

So has anyone sucessfully done this? How did you tie your VML drawing to the
kaMap object?  I tried drawing it in a DIV embedded in a marker anchored to
the coordinate system origin (0,0), but that does not seem to work. Any
ideas?

Jeremy

>
> Joe Franklin wrote:
>
>> I think we are stuck following what google maps/virtual earth do:  
>> use VML for IE and create server side images for the other browsers.
>> an example of VML:
>> http://virtualearth.poly9.com/polyMap/polyline-simple.html
>>
>> js file:
>> http://virtualearth.poly9.com/polyMap/MPolyline.js
>>
>>
>>
>> --- Stephen Woodbridge <woodbri at swoodbridge.com>
>> wrote:
>>
>>  
>>
>>> Paul, et al,
>>>
>>> What are the prevailing thoughts on how to draw routes as overlays 
>>> in ka-map?
>>>
>>> The number of points and be quite extensive, especially if someone 
>>> generates a route across the US.
>>>
>>> -Steve W.
>>> _______________________________________________
>>> ka-Map-users mailing list
>>> ka-Map-users at lists.maptools.org
>>>
>>>   
>>
>> http://lists.maptools.org/mailman/listinfo/ka-map-users
>>  
>>
>>
>>
>>
>>        
>> __________________________________ Yahoo! Mail - PC Magazine Editors' 
>> Choice 2005 http://mail.yahoo.com
>> _______________________________________________
>> ka-Map-users mailing list
>> ka-Map-users at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/ka-map-users
>>  
>>
>
>

_______________________________________________
ka-Map-users mailing list
ka-Map-users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/ka-map-users


More information about the ka-Map-users mailing list