GithubHelp home page GithubHelp logo

Comments (8)

allenhwkim avatar allenhwkim commented on August 15, 2024

hmm, I don't have idea why this is happening. It works for me, but anyone having the same issue, please report.

from map.

gleibfried avatar gleibfried commented on August 15, 2024

Okay, that's strange then, so the Polygon works for you? I'd have liked to try on the project's demo but there's this error in the logs :
TypeError: google.maps[this.mapObjectName] is not a constructor

Okay, so if it works for you it's maybe that it comes from me. I'll keep looking for the problem. And still if anyone has any idea, feel free to tell :)

Thanks!

from map.

allenhwkim avatar allenhwkim commented on August 15, 2024

My mistake. It was working before, now it does not.
image

It's a bug status, and I will look into this issue sooner than later.

from map.

allenhwkim avatar allenhwkim commented on August 15, 2024

It is caused by minification of google maps library done by webpack.

from map.

allenhwkim avatar allenhwkim commented on August 15, 2024

released with 0.9.1, please verify the changes

from map.

gleibfried avatar gleibfried commented on August 15, 2024

Actually that post wasn't about the bug in the example :/ My polygon is still undefined when I enter ngAfterViewInit() :(
I found that we go inside ngAfterViewInit before the polygon is set so the @ViewChild(Polygon) polygon:Polygon variable is still undefined in it, so still this error :
Cannot read property 'initialized$' of undefined

I even tried including it in a setTimeout(() => {...}) with no success.
Otherwise, I just did a button which does a console.log of the polygon and when I click it works.
The thing is that I can't after that make a polygonObject = polygon because then polygonObject, even if it's defined as a google.maps.Polygon, when I try to make a .getPaths() or .getPath() I'm having this error :
this.polygonObject.getPaths is not a function

And also even if the polygon is editable and I've changed some coordinates, the console.log of the polygon isn't updated.

from map.

allenhwkim avatar allenhwkim commented on August 15, 2024

It works for me,

http://plnkr.co/edit/ohwPfa3CmgZQlGeTCx2h?p=preview

You might have missed to import Polygon from ng2-map

from map.

gleibfried avatar gleibfried commented on August 15, 2024

Yeah I think it's not a problem on the library's side. I think I figured and it seems that there's troubles for the global instanciating when you use custom components inside a component, I put my ng2-map stuff in the above component and here it works now.

Thanks @allenhwkim for the help

from map.

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.