Infrastructure Map Server General Discussion

Infrastructure Map Server General Discussion

Reply
Valued Contributor
swimming123
Posts: 87
Registered: ‎04-12-2012
Message 1 of 1 (364 Views)

How to use Fusion API for creating points layer

364 Views, 0 Replies
10-18-2012 03:01 PM

How to create points in the client side by input lonlat values? I try use following code:

 

           var mgApiMapWidgetId = 'Map';
            var MainFusionWindow = GetFusionWindow();
            var pointsLayer = MainFusionWindow.OpenLayers;
            var Fusion = MainFusionWindow.Fusion;
            var mapWidget = Fusion.getWidgetById(mgApiMapWidgetId);
            var map = Fusion.getWidgetById(mgApiMapWidgetId).oMapOL;
            alert("a");          
            pointsLayer.LonLat.fromString("51.2356, -114.235689");
            alert("aa");
            map.addLayers([pointsLayer]);
            alert("aaa");

It can alert to "aa". That means last step not success. Do I need add SRS from the current map? Thank you.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!