<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style title="owaParaStyle"><!--P {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body ocsi="x">
<div dir="ltr"><font color="#3366ff" size="2" face="Tahoma">Hi,</font></div>
<div dir="ltr"><font color="#3366ff" size="2" face="tahoma">I am using the following javascript/fusion code to plot a point(X,Y) on the map in AIMS. But it is not working.
</font></div>
<div dir="ltr"> function ProcessCallBackResult(resulthtml)<br>
{<br>
var points = resulthtml.split('||');</div>
<div dir="ltr"> var point1 = points[0].split('|');<br>
var x1 = point1[0].valueOf();<br>
var y1 = point1[1].valueOf();<br>
var pnt = new Point(x1, y1);<br>
var geom = pnt.X + ',' + pnt.Y;<br>
<br>
DigitizePointCustom(pnt);<br>
// mgApiCallHandlerCustom(pnt);<br>
<br>
// Refresh(); </div>
<div dir="ltr"><br>
function DigitizePointCustom(handler) {</div>
<div dir="ltr"> mgApiStartDigitizingCustom('point', handler)</div>
<div dir="ltr"> }</div>
<div dir="ltr"><br>
function mgApiStartDigitizingCustom(type, handler) <br>
{</div>
<div dir="ltr"> //var mgApiMapWidgetIdCustom = 'Library://DFCC/Layout/Bhaupur.ApplicationDefinition';<br>
var mgApiMapWidgetIdCustom = 'Map';<br>
var mgApiActiveWidgetCustom = null;<br>
var mgApiActiveControlCustom = null;<br>
var mgApiDrawControlsCustom;<br>
var mgApiDigitizingLayerCustom = null;<br>
var mgApiInitializedCustom = false;<br>
mgApiInit();<br>
if (handler)<br>
{<br>
//var Fusion = window.top.Fusion;<br>
var mapWidgetCustom = Fusion.getWidgetById(mgApiMapWidgetIdCustom);</div>
<div dir="ltr"> var map = Fusion.getWidgetById(mgApiMapWidgetIdCustom).oMapOL;<br>
//mgApiActiveWidgetCustom = mapWidgetCustom.oActiveWidget;<br>
<br>
//var map = Fusion.getWidgetById(mgApiActiveWidgetCustom).oMapOL;<br>
var mgApiStyleCustom = new OpenLayers.Style({<br>
pointRadius: 4,<br>
graphicName: "square",<br>
fillColor: "blue",<br>
fillOpacity: 0.4,<br>
strokeWidth: 2,<br>
strokeOpacity: 1,<br>
strokeColor: "#666666"<br>
});<br>
var mgApiStyleMapCustom = new OpenLayers.StyleMap(mgApiStyleCustom);<br>
<br>
Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED, mgApiInit);</div>
<div dir="ltr"> /*Digitizing tool initialization*/<br>
mgApiDigitizingLayerCustom = new OpenLayers.Layer.Vector("Digitizing Layer", {styleMap: mgApiStyleMapCustom,geometryType: 'Point'});<br>
//mgApiCallHandlerCustom(handler)<br>
map.addLayers([mgApiDigitizingLayerCustom]);</div>
<div dir="ltr"> mgApiDrawControlsCustom = { point: new OpenLayers.Control.DrawFeature(mgApiDigitizingLayerCustom, OpenLayers.Handler.Point, { handlerOptions: { layerOptions: { styleMap: mgApiStyleMapCustom}} }) }<br>
<br>
if (mgApiActiveWidgetCustom) {<br>
mapWidgetCustom.deactivateWidget(mgApiActiveWidgetCustom);<br>
}<br>
}<br>
<br>
<br>
}<br>
// function mgApiStyleCustom() {<br>
// var mgApiStyleCustom = new OpenLayers.Style({<br>
// pointRadius: 4,<br>
// graphicName: "circle",<br>
// fillColor: "red",<br>
// fillOpacity: 0.4,<br>
// strokeWidth: 2,<br>
// strokeOpacity: 1,<br>
// strokeColor: "#666666"<br>
// });<br>
// var mgApiStyleMap = new OpenLayers.StyleMap(mgApiStyleCustom);<br>
// <br>
// Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED, mgApiInit);<br>
</div>
<div dir="ltr"> // var point2 = points[1].split('|');<br>
// var x2 = point2[0];<br>
// var y2 = point2[1];<br>
// DigitizePoint(Point);<br>
// Point.x<br>
}<br>
function mgApiCallHandlerCustom(evt) {<br>
var geom = evt.feature.geometry;<br>
var apiGeom = null;<br>
this.handler.CLASS_NAME = 'OpenLayers.Geometry.Point';<br>
apiGeom = new Point(geom.x, geom.y);<br>
<br>
}<br>
//function mgApiDeactivate() {<br>
// if (mgApiActiveControl) {<br>
// mgApiActiveControl.deactivate();<br>
// mgApiActiveControl = null;</div>
<div dir="ltr">// function OnPointDigitized(point) <br>
// {</div>
<div dir="ltr"><br>
// var geomText = "X: " + point.X + "<br>" + "Y: " + point.Y;<br>
// showCoordniate(geomText); <br>
// }<br>
</script><br>
However my point is not visible as a seperate layer on the map. Please help. </div>
<div dir="ltr"><font color="#3366ff" size="2" face="tahoma"></font> </div>
<div><font color="#3366ff" size="2" face="Lucida Calligraphy">Best Regards,</font></div>
<div><font color="#3366ff" size="2" face="lucida calligraphy">Soumyajit Sarker</font></div>
<div><font color="#3366ff" size="2" face="lucida calligraphy">Business Analyst, Geospatial Solutions</font></div>
<div><font color="#3366ff" size="2" face="lucida calligraphy">HCL Technologies Ltd. | Noida - India | Mobile: 9211247194</font></div>
<span style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: gray; FONT-SIZE: 7.5pt; mso-fareast-font-family: 'Times New Roman'">
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><br><br><font style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: gray; FONT-SIZE: 9px">::DISCLAIMER::<br>----------------------------------------------------------------------------------------------------------------------------------------------------</font></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><font style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: gray; FONT-SIZE: 11px">The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.<br>E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, <br>lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents <br>(with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. <br>Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the <br>views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, <br>distribution and / or publication of this message without the prior written consent of authorized representative of <br>HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. <br>Before opening any email and/or attachments, please check them for viruses and other defects.</font></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><font style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: gray; FONT-SIZE: 11px">----------------------------------------------------------------------------------------------------------------------------------------------------</font></span></P></body>
</html>