Code Monkey home page Code Monkey logo

Comments (4)

nickcam avatar nickcam commented on June 8, 2024

Hi @PivotalAnimal,

Is the problem you can't get the library to load in your app at all or is it that you just don't get intellisense as there's no typings file?

You should still be able to use it without a typings file. As it's just a dojo module, include it and load it up as an external reference like you would other external amd libraries. I have no useful experience with webpack, so can't offer any assistance there sorry. If you haven't seen it already this repository could help - https://github.com/tomwayson/angular2-esri-example.

If the problem is just the lack of a typings file - you could create one. Have it inherit from GraphicsLayer and just add the new public methods and properties. If you do create one, feel to create a PR to add it to the repository.

Hope this helps, Nick.

from flareclusterlayer.

klanglie avatar klanglie commented on June 8, 2024

Hi @nickcam

I am looking into the option of creating a typings file. I tried this with ClusterLayer.js from esri but somehow their solution is still not working. Creating a typings file seems pretty straight forward. I think basically all it does is allow tsc to compile and at runtime doesn't do anything. That being said, would I need to include private (those marked with _) in this file or only those exposed by the UI (from the demo _v3 example). BTW - I did take a look at Tom's solution previously. We are using snippets of his code to glue our solution together. Thanks for your help!

Edit - I see you mentioned 'just add the new public methods and properties' - So I will remove '_xxx' ones

Kai

My typings looks something like this now:

`declare module "extras/FlareClusterLayer" {

import Color = require('esri/Color');
import SpatialReference = require('esri/SpatialReference');
import TextSymbol = require('esri/symbols/TextSymbol');
import GraphicsLayer = require('esri/layers/GraphicsLayer');
import Renderer = require('esri/renderers/ClassBreaksRenderer');

interface FlareClusterOptions {
spatialReference?: SpatialReference;
preClustered?: boolean;
clusterRatio?: number;
displaySubTypeFlares?: boolean;
subTypeFlareProperty?: string;
flareColor?: Color;
maxFlareCount?: number;
displaySingleFlaresAtCount?: number;
singleFlareTooltipProperty?: string;
textSymbol?: TextSymbol;
flareShowMode?: string;
clusteringBegin?: () => void;
clusteringComplete?: () => void;
clusterAreaDisplay?: string;
clusterAreaRender?: Renderer;
xPropertyName?: string;
yPropertyName?: string;
idPropertyName?: string;
}

class FlareClusterLayer extends GraphicsLayer {

  constructor(options: FlareClusterOptions);

  setRenderer(renderer: any, clusterAreaRenderer: any): void;

  onClick(e: any): void;

  add(p: any): void;

  clear(): void;

  on(action: string | Function, method: string | Function);

  maxScale: number;

  addPreClusteredData(data: any): void;

  addData(data: any): void;

}
export = FlareClusterLayer;
}
`

from flareclusterlayer.

klanglie avatar klanglie commented on June 8, 2024

Issue solved. Thanks!

from flareclusterlayer.

nickcam avatar nickcam commented on June 8, 2024

Awesome, glad you got it sorted!

from flareclusterlayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.