Giter VIP home page Giter VIP logo

Comments (13)

Nevyn75 avatar Nevyn75 commented on May 31, 2024

Looking into your code I found this inside index.js:

import AMapCoordSys from "./GMapCoordSys";

import "./GMapModel";
import "./GMapView";

echarts.registerCoordinateSystem("amap", AMapCoordSys);

Maybe it's a problem because GMapCoordSys exports "GMapCoordSys"

Thank you.

from echarts-extension-gmap.

plainheart avatar plainheart commented on May 31, 2024

@Nevyn75 Thanks for your review! This is really helpful. It should be gmap but not amap. Fixed in 28334e9 & 4d75251

from echarts-extension-gmap.

plainheart avatar plainheart commented on May 31, 2024

And for the error

"TypeError: Cannot read property 'dataToPoint' of null"

how does your test case look like?

from echarts-extension-gmap.

Nevyn75 avatar Nevyn75 commented on May 31, 2024

Hi.

I already have echarts as dependency in my project.

I discover that your call to:

echarts.registerCoordinateSystem('gmap', GMapCoordSys)

was received by your echarts instance inside your dependencies (in your directory node_modules) and not in mine, so at the end 'gmap' coordinateSystem was not registered and that's why I had a null object.

To make it working I had to copy your js files into my project directly and now it seems ok.

If you could fix this, I would of course prefer to use your package as a module :-)

Thank you

from echarts-extension-gmap.

plainheart avatar plainheart commented on May 31, 2024

Hi, @Nevyn75
I've fixed this issue and released the new version 1.2.1 on NPM, please feel free to help to test it.
Thank you very much.

from echarts-extension-gmap.

helgasoft avatar helgasoft commented on May 31, 2024

Could you please provide working example with series type: 'line' ? Thank you.

from echarts-extension-gmap.

plainheart avatar plainheart commented on May 31, 2024

@helgasoft I'm sorry but only the series that supports the geo coordinate can work in this extension for Google Maps.

from echarts-extension-gmap.

helgasoft avatar helgasoft commented on May 31, 2024

oops, wrong type - it's 'lines', not 'line'. This is supported in 'geo' (paste in Editor) :

option = {
  "yAxis": {  },  "xAxis": { "type": "category"  },
      "title": {
        "text": "DFW",
        "top": 30
      },
      "backgroundColor": "#191919",
      "geo": {
        "map": "world",
        "roam": true,
        "center": [-97.0372, 32.8959],
        "zoom": 4
      },
      "series": [
        {
          "type": "scatter",
          "coordinateSystem": "geo",
          "data": [
            {
              "value": ["-97.0372", "32.89595", "-106.60919", "35.04022", "AA", "DFW", "ABQ", "444"]
            },
            {
              "value": ["-97.0372", "32.89595", " -72.68323", "41.93887", "AA", "DFW", "BDL", "162"]
            },
            {
              "value": ["-97.0372", "32.89595", " -86.75355", "33.56294", "AA", "DFW", "BHM", "168"]
            }
          ],
          "symbolSize": 8
        },
        {
          "type": "lines",
          "coordinateSystem": "geo",
          "data": [
            {
              "coords": [
                ["-97.0372", "32.89595"],
                ["-106.60919", "35.04022"]
              ]
            },
            {
              "coords": [
                ["-97.0372", "32.89595"],
                [" -72.68323", "41.93887"]
              ]
            },
            {
              "coords": [
                ["-97.0372", "32.89595"],
                [" -86.75355", "33.56294"]
              ]
            }
          ],
          "lineStyle": {
            "curveness": 0.3,
            "width": 2,
            "color": "red"
          }
        }
      ]
};

Any similar example for this library ?

from echarts-extension-gmap.

plainheart avatar plainheart commented on May 31, 2024

@helgasoft Here is the demo: https://codepen.io/plainheart/pen/VwpqOYV

from echarts-extension-gmap.

helgasoft avatar helgasoft commented on May 31, 2024

@plainheart, thank you!
My mistake was to use example from the Readme.md where each point has 3 elements [lng,lat,value]. When using type:'lines' however, parameter coords accepts only two [lng,lat], otherwise lines are not drawn.

from echarts-extension-gmap.

neoayi avatar neoayi commented on May 31, 2024

@plainheart 请问一下,目前这个插件貌似不支持 polyline = true, 即多线段绘制属性。是吗

from echarts-extension-gmap.

plainheart avatar plainheart commented on May 31, 2024

@neoayi 应该是可以的。这里有个示例:https://codepen.io/plainheart/pen/LYybaxW

from echarts-extension-gmap.

neoayi avatar neoayi commented on May 31, 2024

from echarts-extension-gmap.

Related Issues (12)

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.