Autodesk MapGuide Developer
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
*Fernando.Digicadd
addPolylin ePrimitive
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
103 Views, 2 Replies
10-24-2001 09:00 AM
Hi!
Anyone knows how to use "addPolylinePrimitive"?? if yes, please send me
one example.
Thanks
Fernando
fernando@digicadd.com.br
Anyone knows how to use "addPolylinePrimitive"?? if yes, please send me
one example.
Thanks
Fernando
fernando@digicadd.com.br
*Kumar, Ramana
Re: addPolylin ePrimitive
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-30-2001 02:23 PM in reply to:
*Fernando.Digicadd
Please find the attached htm file and modify it to your specific needs.
Hope this helps.
Regards,
Ramana
"Fernando.Digicadd" wrote in message
news:EBB29153AC6745AD55845BF1DE4644CC@in.WebX.maYI adrTaRb...
> Hi!
>
> Anyone knows how to use "addPolylinePrimitive"?? if yes, please send
me
> one example.
>
>
> Thanks
>
> Fernando
> fernando@digicadd.com.br
>
>
>
>
Hope this helps.
Regards,
Ramana
"Fernando.Digicadd"
news:EBB29153AC6745AD55845BF1DE4644CC@in.WebX.maYI
> Hi!
>
> Anyone knows how to use "addPolylinePrimitive"?? if yes, please send
me
> one example.
>
>
> Thanks
>
> Fernando
> fernando@digicadd.com.br
>
>
>
>
*Kumar, Ramana
Re:
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-30-2001 02:34 PM in reply to:
*Fernando.Digicadd
Problem in sending the attachments. Find the
contents(code) below.
contents(code) below.
size=2><html>
<head>
<title>Redlining</title>
<script
language="javascript">
function getThisMap()
{
if
(navigator.appName == "Netscape")
return document.myMap;
else
return
window.myMap;
}
{
if
(navigator.appName == "Netscape")
return document.myMap;
else
return
window.myMap;
}
function add_pgon()
{
// get map
object
var map = getThisMap();
// exit function if 'Polygon Name' text box
is empty
if (document.the_form.the_textbox.value == "")
{
alert("Please
enter a polygon name.")
return;
}
// if browser is Netscape, use 'Ex'
version and pass
// observer applet; if browser is Internet Explorer,
//
use 'non-Ex' version with no argument
if (navigator.appName ==
"Netscape")
map.digitizePolygonEx(document.obs);
else
map.digitizePolygon();
}
{
// get map
object
var map = getThisMap();
// exit function if 'Polygon Name' text box
is empty
if (document.the_form.the_textbox.value == "")
{
alert("Please
enter a polygon name.")
return;
}
// if browser is Netscape, use 'Ex'
version and pass
// observer applet; if browser is Internet Explorer,
//
use 'non-Ex' version with no argument
if (navigator.appName ==
"Netscape")
map.digitizePolygonEx(document.obs);
else
map.digitizePolygon();
}
function onDigitizedPolygon(map, numPoints,
points)
{
// create variable and assign it user-specified value
// from
'Polygon Name' text box
var formText =
document.the_form.the_textbox.value;
// create redline layer, or get it if it
already exists
var myLayer = map.getMapLayer("My Redline Layer");
if
(myLayer == null)
myLayer = map.createLayer("redline", "My Redline
Layer");
// create redline object or get it if it exists (getMapObject
//
takes an object key as its value, while createMapObject takes
// a key and a
name -- the formText variable supplies both of
// those values)
var obj =
myLayer.getMapObject(formText);
if (obj == null)
var obj =
myLayer.createMapObject(formText, formText, "");
// create MGCollection that
holds user-specified polygon vertices
var user_vertices =
map.createObject("mgcollection");
user_vertices.add(numPoints);
// use
MGCollection to create polyline primitive and add it to
// redline
object
obj.addPolylinePrimitive(points, user_vertices, false);
// clear
contents of 'Polygon Name' text box
document.the_form.the_textbox.value =
"";
}
points)
{
// create variable and assign it user-specified value
// from
'Polygon Name' text box
var formText =
document.the_form.the_textbox.value;
// create redline layer, or get it if it
already exists
var myLayer = map.getMapLayer("My Redline Layer");
if
(myLayer == null)
myLayer = map.createLayer("redline", "My Redline
Layer");
// create redline object or get it if it exists (getMapObject
//
takes an object key as its value, while createMapObject takes
// a key and a
name -- the formText variable supplies both of
// those values)
var obj =
myLayer.getMapObject(formText);
if (obj == null)
var obj =
myLayer.createMapObject(formText, formText, "");
// create MGCollection that
holds user-specified polygon vertices
var user_vertices =
map.createObject("mgcollection");
user_vertices.add(numPoints);
// use
MGCollection to create polyline primitive and add it to
// redline
object
obj.addPolylinePrimitive(points, user_vertices, false);
// clear
contents of 'Polygon Name' text box
document.the_form.the_textbox.value =
"";
}
function save_it()
{
var
fName = "c:\\My Documents\\my_map.mwf"; // use '/' or '\\', not
'\'
var password = prompt("Please enter a password.",
"");
{
var
fName = "c:\\My Documents\\my_map.mwf"; // use '/' or '\\', not
'\'
var password = prompt("Please enter a password.",
"");
if ( getThisMap().saveMWF(fName,
password) )
alert("Map has been
saved!");
else
alert("Unable to save
map.");
}
</script>
password) )
alert("Map has been
saved!");
else
alert("Unable to save
map.");
}
</script>
<SCRIPT
LANGUAGE="VBScript">
Sub myMap_onDigitizedPolygon(map,
numPoints, points)
onDigitizedPolygon map, numPoints, points
End
Sub
</SCRIPT>
LANGUAGE="VBScript">
Sub myMap_onDigitizedPolygon(map,
numPoints, points)
onDigitizedPolygon map, numPoints, points
End
Sub
</SCRIPT>
</head>
<body>
<OBJECT ID="myMap" WIDTH=1000
HEIGHT=500
CLASSID="CLSID:62789780-B744-11D0-986B-00609731A21 D"
CODEBASE="
href="ftp://ftp.autodesk.com/pub/mapguide/viewer/m gaxctrl.cab#3,0,5,3">ftp://ftp.autodesk.com/pub/m. ..">
<PARAM NAME="URL" VALUE="
href="http://localhost/maps/sample.mwf">http://loc alhost/maps/sample.mwf">
<EMBED SRC="
href="http://localhost/maps/sample.mwf?STATUSBAR=O N">http://localhost/maps/sample.mwf?STATUSBAR=ON"
ALIGN="baseline" BORDER="0" WIDTH="1000"
HEIGHT="500"
NAME="myMap"
TYPE="application/x-mwf">
</OBJECT>
<OBJECT ID="myMap" WIDTH=1000
HEIGHT=500
CLASSID="CLSID:62789780-B744-11D0-986B-00609731A21
CODEBASE="
href="ftp://ftp.autodesk.com/pub/mapguide/viewer/m
<PARAM NAME="URL" VALUE="
href="http://localhost/maps/sample.mwf">http://loc
<EMBED SRC="
href="http://localhost/maps/sample.mwf?STATUSBAR=O
ALIGN="baseline" BORDER="0" WIDTH="1000"
HEIGHT="500"
NAME="myMap"
TYPE="application/x-mwf">
</OBJECT>
<SCRIPT LANGUAGE="JAVAScript">
</SCRIPT>
<FORM NAME="the_form">
Polygon Name:
<INPUT TYPE="text" VALUE="" NAME="the_textbox">
<INPUT TYPE="button"
VALUE="Add/Update Polygon" OnClick="add_pgon();"
NAME="a_button">
<INPUT TYPE="button" VALUE="Save It!"
OnClick="save_it();"
NAME="another_button">
</FORM>
Polygon Name:
<INPUT TYPE="text" VALUE="" NAME="the_textbox">
<INPUT TYPE="button"
VALUE="Add/Update Polygon" OnClick="add_pgon();"
NAME="a_button">
<INPUT TYPE="button" VALUE="Save It!"
OnClick="save_it();"
NAME="another_button">
</FORM>
</body>
</html>
Ramana
"Ramana Kumar" <
href="mailto:ramana.kumar@autodesk.com">ramana.kum ar@autodesk.com> wrote
in message
href="news:7349F09F64A25B08D178AAF1B0180363@in.Web X.maYIadrTaRb">news:7349F09F64A25B08D178AAF1B0180. .....
href="mailto:ramana.kumar@autodesk.com">ramana.kum
in message
href="news:7349F09F64A25B08D178AAF1B0180363@in.Web
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">Please
find the attached htm file and modify it to your specific needs.
Hope
this helps.
Regards,
Ramana
"Fernando.Digicadd"
<fernando@digicadd.com.br> wrote in
message
news:EBB29153AC6745AD55845BF1DE4644CC@in.WebX.maYIadrTaRb...
>
Hi!
>
> Anyone knows how to use
"addPolylinePrimitive"?? if yes, please send
me
> one
example.
>
>
> Thanks
>
> Fernando
>
fernando@digicadd.com.br
>
>
>
>

