Infrastructure Map Server Developer

Reply
New Member
snrsarker
Posts: 2
Registered: ‎08-09-2012
Message 1 of 4 (1,245 Views)

Plotting XY points on the map in AIMS

1245 Views, 3 Replies
08-09-2012 04:44 AM

I have coordinates of a point that I have readfrom a exel sheet provided by the user. I have written the following code in Java Script to digitize(plot that point in this case) that point on the map.  

 

function ProcessCallBackResult(resulthtml)
    {
      var points = resulthtml.split('||');

      var point1 = points[0].split('|');
     var x1=point1[0];
     var y1 = point1[1];   
     var pnt=new Point(x1,y1);
     DigitizePointCustom(pnt);
   //  Refresh();  


    function DigitizePointCustom(handler) {

        mgApiStartDigitizingCustom('point', handler)

    }


    function mgApiStartDigitizingCustom(type, handler) {

        var mgApiMapWidgetIdCustom = 'Map';
        var mgApiActiveWidgetCustom = null;
        var mgApiActiveControlCustom = null;
        var mgApiDrawControlsCustom;
        var mgApiDigitizingLayerCustom = null;
        var mgApiInitializedCustom = false;
        mgApiInit();
        if (handler) {
            //var Fusion = window.top.Fusion;
            var mapWidgetCustom = Fusion.getWidgetById(mgApiMapWidgetIdCustom);
            var map = Fusion.getWidgetById(mgApiMapWidgetId).oMapOL;
            //mgApiActiveWidgetCustom = mapWidgetCustom.oActiveWidget;
           
            //var map = Fusion.getWidgetById(mgApiActiveWidgetCustom).oMapOL;
            var mgApiStyleCustom = new OpenLayers.Style({
            pointRadius: 4,
            graphicName: "square",
            fillColor: "blue",
            fillOpacity: 0.4,
            strokeWidth: 2,
            strokeOpacity: 1,
            strokeColor: "#666666"
        });
        var mgApiStyleMapCustom = new OpenLayers.StyleMap(mgApiStyleCustom);

        Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED, mgApiInit);
        
         /*Digitizing tool initialization*/
         mgApiDigitizingLayerCustom = new OpenLayers.Layer.Vector("Digitizing Layer", {styleMap: mgApiStyleMapCustom});
         map.addLayers([mgApiDigitizingLayerCustom]);

         //mgApiDrawControlsCustom = { point: new OpenLayers.Control.DrawFeature(mgApiDigitizingLayerCustom, OpenLayers.Handler.Point, { handlerOptions: { layerOptions: { styleMap: mgApiStyleMapCustom}}})
         }
            if (mgApiActiveWidgetCustom) {
                mapWidgetCustom.deactivateWidget(mgApiActiveWidgetCustom);
            }
        }
       
       
    }

 

However the issue is the points are not getting plotted/visible on the map space. I am a new coder for autodesk. Please help.

 

Board Manager
Daniel.Du
Posts: 180
Registered: ‎12-23-2008
Message 2 of 4 (1,233 Views)

Re: Plotting XY points on the map in AIMS

08-13-2012 01:11 AM in reply to: snrsarker

Actually you can add an ODBC feature source and layer from Infrastructure Studio without programming. 

 

File -> new Data Connection, select "OSGeo FDO Provider for ODBC".



Daniel Du
Developer Technical Services
Autodesk Developer Network

New Member
snrsarker
Posts: 2
Registered: ‎08-09-2012
Message 3 of 4 (1,229 Views)

Re: Plotting XY points on the map in AIMS

08-13-2012 01:57 AM in reply to: snrsarker

Actually I have read an excel file where my x, y coordinates are given. I want to plot that point on the map in AIMS. My target is to allow the web user to plot the points on the map by simply uploading the coordinates through an excel sheet. Please help...

 

Board Manager
Daniel.Du
Posts: 180
Registered: ‎12-23-2008
Message 4 of 4 (1,218 Views)

Re: Plotting XY points on the map in AIMS

08-13-2012 10:58 PM in reply to: snrsarker

OK, in that case, you need to create a temp feature source and temp layer, then add the point features into this feature source using WebExtension API, I would suggest you to refer these code sample(Solution4/5/6) in http://download.autodesk.com/media/adn/AIMS_Sample_DevTV_Solution_5_6/MapGuideSamples2012.zip 

 

Please also check the AIMS developer center page for more informtion including documents/DevTVs 

http://usa.autodesk.com/adsk/servlet/index?id=946551&siteID=123112

 

 



Daniel Du
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community