<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Articode - Medium]]></title>
        <description><![CDATA[Articode is the software development company providing you unparalleled innovation for enterprise-level software at start-up speed. Head over to our website more info. - Medium]]></description>
        <link>https://medium.com/articode?source=rss----38da0ecc0821---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Articode - Medium</title>
            <link>https://medium.com/articode?source=rss----38da0ecc0821---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 23:49:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/articode" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Geometry Drawing with Angular Cesium]]></title>
            <link>https://medium.com/articode/geometry-drawing-with-angular-cesium-1dfe73b3a8e5?source=rss----38da0ecc0821---4</link>
            <guid isPermaLink="false">https://medium.com/p/1dfe73b3a8e5</guid>
            <category><![CDATA[angular-cesium]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[cesium]]></category>
            <category><![CDATA[cesiumjs]]></category>
            <dc:creator><![CDATA[Eitan Frailich]]></dc:creator>
            <pubDate>Thu, 07 May 2020 12:24:53 GMT</pubDate>
            <atom:updated>2020-05-07T12:24:53.267Z</atom:updated>
            <content:encoded><![CDATA[<h3>Geometry Drawing tools using Angular Cesium</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*5t5DEDTS4leTEO8ov6RwkQ.gif" /></figure><p>In this short blog post, we will learn how to use and customize geometry editors for <a href="https://cesium.com/">CesiumJS</a> using <a href="https://angular-cesium.com/">angular-cesium</a>.</p><blockquote>Angular-cesium is an open-source library that combines the awesome power of CesiumJS as a map engine and Angular as a front end framework. <br>If you are not familiar with angular-cesium then check out this <a href="https://medium.com/articode/intro-to-angular-cesium-e62b11dcaa84">blog post</a>.</blockquote><h3>What are Geometry editors?</h3><p>A common feature in a GIS application is the ability to create/edit geographical entities such as polygons, polylines, etc. As we are working with Cesium we also want to draw entities on 3D models and world terrain.</p><p>angular-cesium has an easy and intuitive service for doing exactly that. The supported shape editors are:</p><ul><li><strong>CirclesEditorService</strong> - For drawing circles</li><li><strong>EllipsesEditorService</strong> - For drawing ellipses</li><li><strong>PolylinesEditorService</strong> - For drawing polylines</li><li><strong>PolygonsEditorService</strong> - For drawing polygons</li><li><strong>PointEditorService</strong> - For drawing points</li><li><strong>RectanglesEditorService</strong> - For drawing rectangles</li><li><strong>HippodromeEditorService</strong> - For drawing hippodromes (Path in cesium)</li></ul><h3>How to use it</h3><p>To learn how to use the editors, we will create a small angular application that implements a polygon selection tool.</p><h4>Initialization</h4><ul><li>Create a new Angular project using Angular CLI:</li></ul><pre>ng new my-shape-drawer</pre><ul><li>Add angular-cesium:</li></ul><pre>ng add angular-cesium</pre><blockquote><em>ng add will install and configure angular-cesium for you, for manual installation click </em><a href="https://docs.angular-cesium.com/getting-started/installation#option-2-manual-install"><em>here</em></a><em>.</em></blockquote><ul><li>angular-cesium editors are a part of AngularCesiumWidgetsModule so we need to add it to our app.module.ts file:</li></ul><pre>@NgModule({<br>  // ...<br>  imports: [<br>    AngularCesiumModule.forRoot(),  <br>    AngularCesiumWidgetsModule,<br>    // ... <br>  ],<br>})<br>export class AppModule {}</pre><h4>Adding the geometry editor to our app</h4><p>Each editor service work with an <em>editor-component</em>. Therefore you need to create an<em> </em><em>editor-component</em>for each editor service. The component needs to be created somewhere inside &lt;ac-map&gt; (the main component for our cesium globe).</p><p>For the polygons editor service, we will add the &lt;polygons-editor&gt; in the app.component.html file:</p><pre>&lt;ac-map&gt;<br>   &lt;polygons-editor&gt;&lt;/polygons-editor&gt; <br>&lt;/ac-map&gt;</pre><p>Usually, we will create a dedicated component for handling the editor logic but for simplicity’s sake, we add the code in the main <em>app.component</em>.</p><p>Next, we need to provide the editor service, in our example PolygonEditorService . The editor service allows us to create() and edit() polygons.</p><pre>@Component({<br>  ...<br>  providers: [PolygonEditorService],<br>})<br>export class MyMapComponent {</pre><pre> editing$: PolygonEditorObservable;</pre><pre> constructor(private polygonEditor: PolygonsEditorService) {}</pre><pre> startDraw() {<br>  this.editing$ = this.polygonEditor.create();</pre><pre>  //// Or Edit from existing points<br>  // const initialPos = [<br>  //  Cesium.Cartesian3.fromDegrees(20, 40),<br>  //  Cesium.Cartesian3.fromDegrees(45, 40),<br>  //  Cesium.Cartesian3.fromDegrees(30, 20)];</pre><pre>  // this.editing$ = this.polygonEditor.edit(initialPos);<br> }<br>}</pre><p>You can provide the service in the root module or if you wish to limit the service access, you can provide it anywhere lower in your component hierarchy.</p><blockquote>All editors have a similar API, this example is relevant to all editors</blockquote><p>Let’s add a simple button that will call our startDraw() :</p><pre>&lt;ac-map&gt;<br>   &lt;polygons-editor&gt;&lt;/polygons-editor&gt; <br>   &lt;button (click)=&quot;startDraw()&quot; class=&quot;fixed-pos&quot;&gt;Create&lt;/button&gt;<br>&lt;/ac-map&gt;</pre><p>That’s it! now we have a polygon drawer ready to use. Try running your application and create your polygon:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1YYNjFSZzSGZTrCDy1H8w.png" /></figure><h4><strong>Customization</strong></h4><p>Ok now we’ve created a polygon but what if we don’t like the default pale blue fill? No problem! the editors are fully customizable.<br>Let&#39;s change the default style so our polygon will look like a selection tool:</p><pre>// create accepts PolygonEditOptions object<br>const editing$ = this.polygonsEditor.create({<br>  pointProps: {<br>   color: Cesium.Color.WHITE,<br>   pixelSize: 10,<br>  },<br>  polygonProps: {<br>   material: Cesium.Color.TRANSPARENT,<br>  },<br>  polylineProps: {<br>   material: () =&gt; new Cesium.PolylineDashMaterialProperty()<br>  }<br>});</pre><p>Result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Njcg3iXoFANj5IYhpCQOrg.png" /></figure><p>The editor click events are configurable too. The default events are: click for adding points and double click for finish creating the shape. These events can be changed to whatever you’d like. Learn more about the different options <a href="https://docs.angular-cesium.com/widgets/shape-editors/polygon-editor">here</a>.</p><h4>Controlling our editable geometry</h4><p>All editors return a custom Observer object that allows us to subscribe to different shape actions and to manipulate our geometry from the code. For more details about the different options click <a href="https://docs.angular-cesium.com/widgets/shape-editors#controlling-your-edited-geometry">here</a>.</p><p>In our selection tool use case, we will use the dispose() method to delete the shape after it was created.<br>Then we will use a simple npm package called<a href="https://www.npmjs.com/package/point-in-polygon">point-in-polygon</a> to determine if our entities are in the selected polygon area.</p><pre>import pointInPolygon from &#39;point-in-polygon&#39;;</pre><pre>startDraw() {<br>  const polygon$ = this.polygonEditor.create( { //...options } );<br>  <br>  polygon$.subscribe((editUpdate: PolygonEditUpdate) =&gt; {<br>      if (editUpdate.editAction === EditActions.ADD_LAST_POINT) <br>        // Remove the editable polygon<br>        this.editing$.dispose();<br>        <br>        // Find all entities in the polygon location<br>        const polygonArr = this.editing$.getCurrentPoints()<br>        .map(p =&gt; p.getPosition())<br>        .map(cart =&gt; CoordinateConverter.cartesian3ToLatLon(cart))<br>        .map(latLon =&gt; [latLon.lon, latLon.lat]);</pre><pre>        const myEntities = this.store.getEntities();<br>        myEntities.forEach(entity =&gt; {<br>         console.log(pointInPolygon(entity.position, polygonArr)); <br>         // Or update the entity<br>       });<br>      }<br>    });<br> }</pre><p>The final result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*r4zEGdHo6uG9nXfXHzeLgA.gif" /></figure><h4>Recommended data flow</h4><p>As we saw in the example, we can use the editors to create and edit entities. So, should we use it to display our geographical data? For example, a list of polygons we fetched from the server? The short answer is - No!<br>Editors services are used for creating editable entities, if you want to display regular entities you should use the normal <a href="https://docs.angular-cesium.com/core-concepts/ac-layer">ac-layer</a> API.</p><p>So what will be the right flow when I want to create a new geographical entity in my app? The recommended flow will be:</p><ol><li><em>Create a geographical entity using the service editor.</em></li><li><em>Finish editing and manipulating your entity.</em></li><li><em>Save the entity in the app store (and in the server, if needed).</em></li><li><em>The store update should trigger entity rendering by the relevant </em><em>ac-layer .</em></li></ol><p>This way your app will be consistent with the server and your architecture will remain flexible to support entity updates and creation of new entities.</p><h3>Who we are?</h3><p>We are Articode, a software development company that specializes in GIS systems. We love open-source and we are the creators and maintainers of angular-cesium.</p><p>Check out <a href="https://articode.co/">articode.co</a> for more information and contact info.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1dfe73b3a8e5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/articode/geometry-drawing-with-angular-cesium-1dfe73b3a8e5">Geometry Drawing with Angular Cesium</a> was originally published in <a href="https://medium.com/articode">Articode</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing Fineract as a Service, an On-Demand Financial Core]]></title>
            <link>https://medium.com/articode/announcing-fineract-as-a-service-an-on-demand-financial-core-3f38a0bf0a3a?source=rss----38da0ecc0821---4</link>
            <guid isPermaLink="false">https://medium.com/p/3f38a0bf0a3a</guid>
            <category><![CDATA[fineract]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[core-banking-solutions]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[fintech]]></category>
            <dc:creator><![CDATA[David Yahalomi]]></dc:creator>
            <pubDate>Tue, 05 May 2020 11:54:38 GMT</pubDate>
            <atom:updated>2020-05-09T09:18:23.127Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZkFMjqocYXLSAdifPreLiQ.png" /></figure><p>And it’s free to use for development purposes!</p><p><strong>TLDR:</strong> We’ve developed a tool that automatically deploys a financial core and back-office system for any financial organization. The core takes care of accounting, portfolio management, and CRM functionality for any financial institution. It allows you to onboard customers and to manage loans, deposits, and current accounts for both individuals and corporations. <a href="https://faas.articode.co/">Try It!</a></p><h3><strong>Why?</strong></h3><p>Last year, we started a project for a client that demanded a financial core. From past endeavors, I’ve known about <a href="https://fineract.apache.org/">Fineract</a>— An open-source, financial core that had everything we could ever want. We’ve begun working with it and quickly saw the power of having a full REST API for any financial action that we needed.</p><ul><li>Need to process a customer’s information in order to comply with a KYC directive? — you’ve got it.</li><li>Need an accounting module with a full accounting tree that links to any financial activity? No problem. got it.</li><li>Need powerful reports? You’ve got it!</li><li>Loans, Deposits, and Checking Accounts? Done, Done, And Done!</li></ul><h3><strong>Should I Care?</strong></h3><p>Well, if you’re part of the fintech industry, you already know that financial services cannot continue to exist as they are. You’ve got to offer more flexible, transparent, and available services to your customers, as they expect nothing less than that.<br>Having a powerful financial core available using a simple REST API, allows you to plan for the next big thing! It allows automation of manual processes, integration of external services easily, and could also support various solutions such as e-wallets, smart payment platforms, an exchange platform, and much much more!</p><p>By also including a simple back-office application — <a href="https://github.com/openMF/community-app">Mifos X Community App</a>, you could start to offer credit today! (provided you are licensed to do so in your country)</p><h3><strong>Fine, Show It To Me!</strong></h3><p>Our main goal with this service was to allow an easy, no-strings-attached, deployment of your next financial core, and to allow you to experiment however you’d like.</p><p>By going to <a href="https://faas.articode.co/">https://faas.articode.co/</a> you will get just that. In 3 easy steps, you will be GTG!</p><ol><li>Enter the name of your next financial solution</li><li>Upload your logo</li><li>Enter a bit of personal information (For the sake of analytics)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fEkdvIfiqRXqH4yWYpHshA.png" /></figure><p><strong>And presto!</strong> You receive an email telling you that your instance is ready to use, batteries included, and everything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CFpaJwa_SBcPyFFA" /></figure><p>Now, we should maybe try it out?</p><h3><strong>Testing My Brand Spanking New Financial Core</strong></h3><p>So the first thing you can do is to go play with <a href="https://mifos.org/">Mifos X</a>, the back-office app. In the email, you’ve received a link to your back-office — pre-configured with your instance. Enter the username and password you’ve received, and log in.</p><p>Now, let’s create your first loan product. For the sake of this example, we will create a simple financing solution for a bulk order of peanuts. Such a solution requires a loan that will be given to the customer at the point of sale and will allow the seller to receive his asked price while allowing the customer to pay small monthly payments. Think of most e-commerce sites lately and their financing option (Affirm, AfterPay, etc...).</p><p>Go to the Admin menu -&gt; Products -&gt; Loan Products -&gt; Create Loan Product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yiv3phmVeGkDzlb-yxjZeQ.gif" /></figure><p>Now you will be taken through a six-step wizard which will allow you to set up the different terms of the product, various technical settings, charges, and also will allow you to configure accounting ledgers for the product.<br>Again, for the simplicity of this post, we will focus on what makes this product a peanut financing solution.</p><p>In the terms step I’ve set the following terms:</p><ul><li>Principal (How much of the cost, we are willing to cover) — Min: $100, Max: $10,000.</li><li>Number of repayments — Min: 2, Max: 36</li><li>Repay every: 1 month</li><li>Interest Rate (Our profit for in this financing solution) — Min: 0.1%, Max: 10% for the whole term. This creates borders for our solution and the actual interest rate should be derived from the credit score and term of the financing.</li></ul><p>I’ve left the rest of the settings as they are meant to be used in more complex solutions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*u_gotzqcgCcDjubJjw78Lw.gif" /></figure><p>Now, if a customer enters our office tomorrow and wants to buy 10 tons of peanuts, we could (technically) offer a financing solution.</p><p>To create a new client press on the Clients menu -&gt; Clients -&gt; Create Client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*itzcToctf3zCvAeWy5TMTg.gif" /></figure><p>And after entering the basic info of our customer, we create a new loan for them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*p1bx_EQgXkmmm02JfKVEjw.gif" /></figure><p>We set the amount, requested installments, the interest rate, and just like that the system has already created a repayment info table for our customer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ehwSqZeXC6CYZJpd9g5QoQ.png" /></figure><p>After that, all that remains is the approval of the said loan and that’s it, you’ve got yourself a working financial solution that fits well into your business and we’ve already served one of your customers! 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_r_OCrVaudHzgLr3UQE-CA.png" /></figure><h3>Summary</h3><p>The financial services world is quickly changing thanks to the large number of new startups diving headfirst into this space.</p><p>Although that is the case, a lot of those startups are focusing on giving the customer, the best possible user experience, as they should. While the core of every one of those financial solutions is pretty much the same, it does take a significant amount of effort to create a unique and seamless financial solution that is tailored to the customer needs.</p><p>By using the tools I’ve shown in this post, you can focus on what matters most, and leave the already-solved problems to <a href="https://fineract.apache.org/">Fineract</a> and <a href="https://mifos.org/">Mifos X</a>, Open Source financial core and back-office app that is already being used by over 500 institutions around the world.</p><h3>Who We Are?</h3><p>Articode is a software development company that specializes in building financial solutions for Fintech companies. We use (and contribute to) various open-source projects such as Fineract in order to quickly build and deploy slick and customer-centric mobile and web applications.</p><p>Head over to <a href="https://articode.co/">articode.co</a> for more information and contact info.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f38a0bf0a3a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/articode/announcing-fineract-as-a-service-an-on-demand-financial-core-3f38a0bf0a3a">Announcing Fineract as a Service, an On-Demand Financial Core</a> was originally published in <a href="https://medium.com/articode">Articode</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intro to Angular-Cesium]]></title>
            <link>https://medium.com/articode/intro-to-angular-cesium-e62b11dcaa84?source=rss----38da0ecc0821---4</link>
            <guid isPermaLink="false">https://medium.com/p/e62b11dcaa84</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[cesiumjs]]></category>
            <category><![CDATA[cesium]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Eitan Frailich]]></dc:creator>
            <pubDate>Thu, 02 May 2019 11:00:12 GMT</pubDate>
            <atom:updated>2019-05-02T11:00:12.789Z</atom:updated>
            <content:encoded><![CDATA[<p>This post explores <a href="https://github.com/articodeltd/angular-cesium">angular-cesium</a>, an open source library for working with CesiumJS and Angular. angular-cesium allows you to handle multiple real-time data sources in a very simple and intuitive way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*0p60rAVCTv2421Nb.jpg" /></figure><h3>What is angular-cesium?</h3><p>angular-cesium combines the awesome power of CesiumJS as a map engine and Angular as a front end framework. angular-cesium’s major benefit is its ability to keep your map (or maps) in perfect sync with all your data sources, whether they are dynamic data sources that push a lot of data over a websocket, or a single HTTP data source that fetches data once, or a user action that changes your inner application state. You can manage all this by using very simple and readable Angular components while focusing on high performance and easy usage.</p><p>angular-cesium main features and abilities:</p><ul><li><strong>Declarative template syntax</strong> — Build your Cesium application using Angular components and Angular templates syntax.</li><li><strong>Extra features and abilities</strong> — angular-cesium come packed with an awesome set of tools that solve many of the common issues that GIS systems usually face and let you build your system super fast, including map events handling, camera utilities, and graphics drawing tools.</li><li><strong>Plug and Play</strong> — angular-cesium allows easy integration between any data source and displaying it on the map, using Angular RxJs data streams (as shown in the diagram below).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*5tkQ1KhTxic98Atx.png" /></figure><p>angular-cesium achieves this with RxJS, a core library used by Angular for representing data streams. (In short, you can subscribe to the stream and get notified when new data arrives. If you not familiar with it you can read more <a href="https://angular.io/guide/rx-library">here</a>.) Once a data source has been wrapped with an Rx observable, it can be passed to angular-cesium and then the magic happens :) All you need to do is create an Angular component that uses that data stream in its template. There, you’ll describe how you want the entities on the stream to look when drawn on the map. We’ll see a simple example of that later.</p><blockquote><em>It’s important to mention that angular-cesium only extends and decorates the CesiumJS API, but if you want to use the normal Cesium API you always have </em><a href="https://github.com/articodeltd/angular-cesium#mapsmanagerservice"><em>access</em></a><em> to the Cesium Viewer object.</em></blockquote><h3>The basics</h3><p>Let’s go over the basics of how to work with angular-cesium. We will create a small application that shows and updates airplanes on the globe.</p><p><a href="https://github.com/articodeltd/angular-cesium#new-angular-cli-project">Learn here</a> how to install and create a new angular-cesium project.</p><h3>Create your Cesium globe</h3><p>&lt;ac-map&gt; component creates your Cesium viewer. Just add it to your app.component.html:</p><pre>&lt;ac-map&gt;&lt;/ac-map&gt;</pre><p>Now try running your app, in the console: npm start or ng serve. Go to localhost:4200 and you should see the Cesium globe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*vITAeGadZ2EflGQ4.png" /></figure><h3>Add spatial data to your map</h3><p>After creating the Cesium viewer we will want to add spatial data to our application. angular-cesium supports all Cesium entities as components. See the <a href="https://github.com/articodeltd/angular-cesium#supported-entity-types">full list of components</a>.</p><p>angular-cesium uses <a href="https://cesium.com/docs/tutorials/creating-entities/">Cesium entities syntax</a>, so it’s good to be familiar with it. So let’s start with adding a layer of planes to our app. Our app will show a list of planes that can update. Let’s say each plane will consist of a label and a billboard (icon).</p><p>We’ll create a new component planes-layer.component.html:</p><pre>&lt;ac-layer acFor=&quot;let plane of planes$&quot; [show]=&quot;showTracks&quot; [context]=&quot;this&quot;&gt;<br>    &lt;ac-billboard-desc props=&quot;{<br>        image: plane.image,<br>        position: plane.position<br>    }&quot;&gt;<br>    &lt;/ac-billboard-desc&gt;<br><br>    &lt;ac-label-desc props=&quot;{<br>        position: plane.position,<br>        text: plane.name,<br>        color: getColor(plane)<br>    }&quot;&gt;<br>    &lt;/ac-label-desc&gt;<br>&lt;/ac-layer&gt;</pre><p>Let’s understand what we did here: we used the Angular template syntax to tell Cesium that each plane will consist of a billboard and a label.</p><p>Our plane consists of ac-billboard-desc and ac-label-desc, which are wrapper components for Cesium <a href="https://cesiumjs.org/Cesium/Build/Documentation/LabelGraphics.html?classFilter=lab">LabelGraphics</a> and <a href="https://cesiumjs.org/Cesium/Build/Documentation/BillboardGraphics.html?classFilter=bill">BillboardGraphics</a>, accordingly.</p><p>angular-cesium supports all Cesium entities; each component has a -desc suffix, short for description, because the component describes how our plane should look.</p><p>Each description component has a props attribute which accepts the same options as the corresponding Cesium class. In our case ac-billboard-desc accepts the same members as Cesium <a href="https://cesiumjs.org/Cesium/Build/Documentation/BillboardGraphics.html?classFilter=bill">BillboardGraphics</a>. This way you can configure your entities any way you want, like setting position, text, image, or any options you desire.</p><h4>Layers and ac-layer component</h4><p>OK, now we have defined what each plane should look like. Next we want to create a list of planes or a layer of planes.</p><p>ac-layer represents an array of entities that will be displayed on the map according to the description components. It works with RxJs Observables, meaning it is compatible with the Angular workflow.</p><p>Possible attributes:</p><ul><li>acFor accepts a data stream (RxJs Observable) in a “let enityName of observer$” syntax (The $ suffix is a common convention for naming observables).</li></ul><p>In our example we accept plane$ observable; ac-layer will subscribe to the observable and will handle all updates for us.</p><ul><li>show show or hide the layer.</li></ul><h3>Connect to data</h3><p>Let’s see what planes.component.ts (our component logic) looks like:</p><pre>@Component({<br>  selector: &#39;plane-layer&#39;,<br>  templateUrl: &#39;plane-layer.component.html&#39;,<br>})<br><br><strong>export</strong> <strong>class</strong> PlaneLayerComponent implements OnInit {<br>  planes$: Observable<strong>&lt;</strong>AcNotification<strong>&gt;</strong>;<br><br>  <strong>constructor</strong>(private planesService: PlanesService) {<br>  }<br><br>  ngOnInit() {<br>    <strong>this</strong>.planes$ <strong>=</strong> <strong>this</strong>.planesService.getPlanes().pipe(<br>      map(plane <strong>=&gt;</strong> ({<br>        id: plane.id,<br>        actionType: ActionType.ADD_UPDATE,<br>        entity: plane,<br>      }))<br>    );<br>  }<br><br>  getColor(plane) {<br>    <strong>if</strong> (plane.name.startsWith(&#39;Boeing&#39;)) {<br>      <strong>return</strong> Cesium.Color.Green;<br>    } <strong>else</strong> {<br>      <strong>return</strong> Cesium.Color.White;<br>    }<br>  }<br>}<br><br><em>// Example mock service</em><br><br>@Injectable({<br>  providedIn: &#39;root&#39;<br>})<br><br><strong>export</strong> <strong>class</strong> PlanesService {<br>  private planes <strong>=</strong> [<br>    {<br>      id: &#39;1&#39;,<br>      position: Cesium.Cartesian3.fromDegrees(30, 30),<br>      name: &#39;Airbus a320&#39;,<br>      image: &#39;https://cdn3.iconfinder.com/data/icons/airport-collection/100/23-512.png&#39;<br>    },<br>    {<br>      id: &#39;2&#39;,<br>      position: Cesium.Cartesian3.fromDegrees(31, 31),<br>      name: &#39;Boeing 777&#39;,<br>      image: &#39;https://cdn1.iconfinder.com/data/icons/fly-airbus-and-aeroplane/154/fly-air-plane-airbus-aeroplane-512.png&#39;<br>    }<br>  ];<br><br>  getPlanes() {<br>    <em>// Or get it from a real updating data source</em><br>    <strong>return</strong> Observable.<strong>from</strong>(<strong>this</strong>.planes);<br>  }<br>}</pre><p>We learned that you must provide a data source to ac-layer for the [acFor] attribute and the data source must be an RxJs stream.</p><p>The next thing we learn is that every notification on the stream should be of type AcNotification:</p><pre>interface AcNotification {<br>    id: string;<br>    actionType: ActionType;<br>    entity?: any;<br>}</pre><p>id - unique entity key,</p><p>entity- the data itself for the entity,</p><p>actionType- presents what happened to the entity. actionType can be one of these values: ADD_UPDATE, DELETE.</p><p>Each AcNotification you pass to plane$ Observable will make angular-cesium render the wanted plane according to the description components defined inside the ac-layer. It possible to add costume logic to define for each property. In our example, each plane color is determined by getColor().</p><p>In the case that ADD_UPDATE is passed, the entity will be created or updated depending on whether it exists or not. In the case that DELETE is passed, the entity will be removed from the map.</p><p>In our example we have PlanesService, which returns planes data as RxJs stream. Here it’s only hard-coded data, but in the same way, it could be data from a websocket, HTTP response, or whatever you desire.</p><p>In planes.component.ts we get the data from planeService.getPlanes() and map them to $plane that is given to ac-layer. Each plane is converted to an AcNotification object. ac-layer will subscribe to $plane and render our planes accordingly.</p><p>Don’t forget to add your component to app.component.ts.</p><pre>&lt;ac-map&gt;<br>    &lt;plane-layer&gt;&lt;/plane-layer&gt;<br>&lt;/ac-map&gt;</pre><p>All the angular-cesium map layers that you create need to sit under the ac-map hierarchy. This is the way that all the components and layers know which globe they should be rendered on. You also get a nice declarative representation of the layers in your viewer.</p><p>That’s it, now you should see planes on your globe :)<br><a href="http://www.angular-cesium.com/">Result example</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/0*XfvmO3BOygBR9Y8f.png" /></figure><p>Next, you can add more layers or make your planes more verbose by adding more Cesium entities or setting different properties. The possibilities are endless.</p><h4>How does it work?</h4><p>Now, after we created a couple of planes on the map, let’s drill down and understand how entities will be drawn on the map.</p><p>We pass props to ac-billboard-desc as expressions that are based on the plane that we defined earlier. Actually, we say: ‘Dear angular-cesium, please create and manage a billboard using those expressions for each plane. Now, when an entity is passed through the stream—based on its id, actionType, and entity—angular-cesium will know what to do. For example, when passing data with the same id and actionType=ADD_UPDATE, the entity will be updated on the map for every message.</p><h3>Widgets and utilities</h3><p>As mentioned above, angular-cesium has many widgets and utilities:</p><p><strong>Graphics Drawing Tools</strong>:</p><ul><li>angular-cesium comes with a set of utils that can be used to draw graphics over the map.</li><li>The tools are highly configurable services for creating and editing a variety of geometries such as lines, circles, polygons, and ellipses.</li><li>Want to create a tool that measures distance and bearing between two points on the map? Do a bit of customization to the polylines drawing tool and you’re set to go. Neat :)</li><li>Try the different editors in our <a href="http://angular-cesium.com/">demo</a>, and for additional information check out the <a href="https://github.com/articodeltd/angular-cesium#geometry-editors-and-widgets">doc</a>.</li></ul><p><strong>Control of Mouse Events</strong></p><ul><li>Another major benefit of angular-cesium is what we call the “map events manager,” which is a very cool tool that lets you take full control of mouse events that occur on the map, such as the usual left mouse click, right mouse click, but also events such as long left press or drag and drop.</li><li>Allows Entity picking — click on the billboard and you will get the related entity.</li><li>Prioritize your events API.</li><li>Handle Plonter: How to handle entities selection when the entities are on top of each other.</li><li>Check out the <a href="https://github.com/articodeltd/angular-cesium#geometry-editors-and-widgets">doc</a> for additional information.</li></ul><p><strong>Multiple viewers support</strong></p><ul><li>angular-cesium allows you to show multiple maps and sync the data displayed in them with ease.</li></ul><p><strong>Bind Angular componets to the map</strong></p><ul><li>Angular-Cesium allows you to use HTML elements or Angular components as map entities and anchor their position to the map geo coordinates. This is especially useful when you want to display things like complex forms with some css over it to get a good looking result.</li></ul><p><strong>And more…</strong></p><h3>Benefits</h3><p>After explaining a little bit about ac-layer we hope that you may see the benefits of angular-cesium:</p><ul><li>Easily defining data layers .</li><li>Easily add/update/remove entities — all you have to do is pass a message through the stream, and angular-cesium will keep track of the rest.</li><li>Readable and maintainable code — when reading your HTML, which describes your layer, it is pretty easy to understand how your layer will look.</li><li>Performance — take full advantage of cesium performance with zero overhead from Angular change detection or DOM manipulation.</li><li>Take full control of mouse events with custom events such as drag and drop.</li><li>Bind Angular components to the map and handle them like map entities using ac-html.</li><li>Built in graphics drawing tools.</li><li>Multiple viewers synchronization.</li></ul><h3>Conclusion</h3><p>angular-cesium was born out of the need to handle multiple data sources in a consistent and efficient way while keeping an ever-growing code base maintainable and readable. In our experience, Cesium is the best solution when it comes to 3D + 2D spatial data visualization. With angular-cesium, we’ve expanded Cesium’s awesome capabilities with fast data sources integration and various tools while keeping the Cesium API fully accessible.</p><h3>More info</h3><p>This is just the basics of angular-cesium. For more info check out our <a href="https://articodeltd.github.io/angular-cesium/">API doc</a> and angular-cesium <a href="https://github.com/articodeltd/angular-cesium">Repository</a>. Try cloning the project and play with our demo. angular-cesium is an open source project. Feel free to open issues, ask questions, and open PRs.</p><p>Our roadmap includes support for other popular frameworks such as ReactJS, so stay tuned. For additional support, options contact us: <a href="/service/mailto:contact@articode.co">contact@articode.co</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e62b11dcaa84" width="1" height="1" alt=""><hr><p><a href="https://medium.com/articode/intro-to-angular-cesium-e62b11dcaa84">Intro to Angular-Cesium</a> was originally published in <a href="https://medium.com/articode">Articode</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing Broken npm Packages]]></title>
            <link>https://medium.com/articode/fixing-broken-npm-packages-d8f808657d8e?source=rss----38da0ecc0821---4</link>
            <guid isPermaLink="false">https://medium.com/p/d8f808657d8e</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[bugs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Eliezer Steinbock]]></dc:creator>
            <pubDate>Sun, 03 Mar 2019 15:32:15 GMT</pubDate>
            <atom:updated>2020-03-15T16:02:39.975Z</atom:updated>
            <content:encoded><![CDATA[<h3>Techniques for Fixing npm Packages</h3><p>If you’re a Javascript you likely make use of many npm packages. There are times a package has a bug or doesn’t do exactly what you want. This post details a few different ways to work around this.</p><p>I have often found myself wasting hours trying to make a one line fix, so I hope the strategies listed here will be of help to others. Many of the tools mentioned are also useful when developing a package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NzKbzPiOaAKE6iHxgvAF0g.png" /></figure><h3>Solutions</h3><p>We’ll start with the obvious. The most basic thing you can do to solve your problems is to use a different package. If it’s a small piece of functionality, you can rewrite it yourself and avoid having to use the package.</p><p>This sometimes works, but if the package contains a lot of code this solution may not be practical. Beyond completely rewriting from scratch, you could copy and paste the contents of the package into your local project and edit as you need. The disadvantage of such an approach is that you won’t be able to easily follow future updates made by others to the package. Likely not the best solution in many instances.</p><p>Perhaps the first thing you should do before trying to fix a package yourself is post an issue in the GitHub repo. The functionality you are trying to add may already exist, or you are misusing the library and the package maintainers can point you in the right direction. If it really is a bug the package maintainers are likely the ones best suited to fix it.</p><h3>Fix Locally</h3><h4>npm/yarn link</h4><p>The first way to fix a package is to fork and clone it locally. You can then use npm link or yarn link to use it in your project. Any changes you make to the forked package will be reflected in your project.</p><p>You need to run two commands to link. <a href="https://yarnpkg.com/lang/en/docs/cli/link/">Using yarn</a>:</p><pre>yarn link # in the root of the forked package<br>yarn link forked-package # in the root of your project</pre><p>You will also need to run yarn install on the forked package and run any build/prepublish steps. In the past I have sometimes found the build/prepublish step to be annoying to get working. Your mileage may vary and it depends on how the package was written.</p><p>Another problem with this solution is that it only creates a local symlink to the package. This means that you’ve only solved the problem locally, but not for team members.</p><p>Once you’ve fixed the problem locally, you will want to publish it to GitHub and either rely on your forked version of the package, make a pull request to the main package, or publish the package to npm under your name.</p><p>Read more about npm link here:</p><p><a href="https://medium.com/dailyjs/how-to-use-npm-link-7375b6219557">How to use npm-link</a></p><h4>yalc</h4><p><a href="https://github.com/whitecolor/yalc">Yalc</a> is similar to npm link, but it publishes the forked package locally rather than creating a symlink. I have found that it often works better than npm link as it handles the full build process a package maintainer uses to publish to npm including npm pack.</p><p>Using <a href="https://github.com/whitecolor/yalc">yalc</a> is similar to using npm/yarn link:</p><pre>npm i yalc -g<br>yalc publish # in the root of the forked package<br>yalc add forked-package # in the root of your project</pre><p>One problem I’ve run into using yalc is when you want to fix a package that is depended on by another package. For more discussion on that situation see <a href="https://github.com/whitecolor/yalc/issues/16">this</a> issue.</p><p>You can commit yalc changes to git to share the fix with other team members. This is useful to make a quick fix, although likely should not be used as a long term solution.</p><h4>patch-package</h4><p>Another solution is to use <a href="https://github.com/ds300/patch-package">patch-package</a>. To make use of it you don’t need to fork the buggy package. You can simply edit your node_modules directory with the changes you want.</p><p>To use patch-package:</p><pre>yarn add patch-package postinstall-postinstall</pre><pre># add to your package.json:<br> &quot;scripts&quot;: {<br>   &quot;postinstall&quot;: &quot;patch-package&quot;<br> }</pre><pre># fix the broken file in your project:<br># e.g. node_modules/some-package/brokenFile.js</pre><pre># then run the following to apply the patch:<br>yarn patch-package package-name</pre><p>You can add the patches to your git repo to share the changes with the rest of the team. Patch-package applies these changes to the project itself by creating a patch file with the changes.</p><p>There are some problems with patch-package however. When a package author publishes a project to npm, many of the original files are lost in the process.</p><p>For example, if the project was written in TypeScript/ES6+, the original files may not have been published to npm, just the final transpiled version. This is the case if the package.json contains the files field, or the project contains a .npmignore file. Then not all the files in the project will be downloaded to your node_modules folder. Usually this is a good thing as it reduces the amount of data that needs to be downloaded, but it makes it difficult to use patch-package.</p><p>You can still edit the final ES5 or minified version using patch-package, but this is usually an uncomfortable experience.</p><p>Also, even if the src folder has been published to npm, you will still need to run the build steps locally. If some of the files necessary to build the project have been excluded, this will not be possible unless you grab the missing files from GitHub. At this stage it may just be easier to clone the package locally in a separate folder.</p><p>Beyond this, any fixes you make with patch-package are not shared with the wider community and anyone else using this package that may benefit from your changes.</p><p>UPDATE: if you’d like to watch a quick video on using patch-package see this video by Ben Awad:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F2AVs-Yh1bS8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2AVs-Yh1bS8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2AVs-Yh1bS8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4280563d3ccb364e0be163e96b6139f/href">https://medium.com/media/f4280563d3ccb364e0be163e96b6139f/href</a></iframe><h4>Fork on GitHub</h4><p>Another solution is to make the changes you need and publish them to GitHub/GitLab (or any other source control platform you use).</p><p>This can often be done in conjunction with the steps above. You may first make the fixes using <em>npm/yarn link</em> or <em>yalc</em>, check that all works as expected and then push the changes to your own Git repo. You can then run one of the following to add the package to your project and make it accessible to others (changing the url as appropriate):</p><pre>yarn add https://github.com/fancyapps/fancybox [remote url]<br><br>yarn add https://github.com/fancyapps/fancybox#3.0 [branch/tag]<br><br>yarn add https://github.com/fancyapps/fancybox#5cda5b529ce3fb6c167a55d42ee5a316e921d95f [commit]</pre><p>If you need to do any automated builds, you can take a look at this <a href="https://stackoverflow.com/questions/48287776/automatically-build-npm-module-on-install-from-github">StackOverflow post</a>.</p><p>At this point you can also make a Pull Request to the main repo to get the changes merged in for everyone using the package. Once the changes have been merged in you can go back to using the original package.</p><p>Along these lines, you can also republish the package under your own npm account and then install it as you would any npm package.</p><h3>Other Solutions</h3><p>If you are using a monorepo setup with something like Lerna or Rush, you can clone the package in question locally, and use it as you would any other Lerna package in your project.</p><p>The final solution available is monkey patching. You can read more about monkey patching in Node.js <a href="https://johncoder.com/monkey-patching-in-node-js/">here</a>.</p><h3>Final Words</h3><p>None of the solutions above are perfect. Either patch-package or a yalc followed by committing the changes to GitHub is my favoured solution of those listed above. But all the solutions have problems. After all these years, we are still missing the holy grail for simple package fixes.</p><p>If you know of some solutions that I’ve missed and know a better way to fix problems I would love to know in the comments below!</p><p>If you enjoyed this article be sure to give me like and follow for similar content in the future :). You can follow me on Twitter at:</p><p><a href="https://twitter.com/elie2222">Elie Steinbock (@elie2222) | Twitter</a></p><p>Some good follow up discussion can be found here:</p><iframe src="https://cdn.embedly.com/widgets/media.html?type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=reddit&amp;url=https%3A//www.reddit.com/r/node/comments/axjjpa/techniques_for_fixing_npm_packages/&amp;image=https%3A//i.embed.ly/1/image%3Furl%3Dhttps%253A%252F%252Fexternal-preview.redd.it%252Fa35b36UP0i13WNmGd52lesrASgUPvLhS9YSHiNfiOYI.jpg%253Fauto%253Dwebp%2526s%253D1b5c906de79e2478a39d97b29cbe400f9ce707bd%26key%3Da19fcc184b9711e1b4764040d3dc5c07" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/f649cb4dbf33166c456ab4590bd29bbf/href">https://medium.com/media/f649cb4dbf33166c456ab4590bd29bbf/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8f808657d8e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/articode/fixing-broken-npm-packages-d8f808657d8e">Fixing Broken npm Packages</a> was originally published in <a href="https://medium.com/articode">Articode</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>