Comments (8)
hmm, I don't have idea why this is happening. It works for me, but anyone having the same issue, please report.
from map.
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.
My mistake. It was working before, now it does not.
It's a bug status, and I will look into this issue sooner than later.
from map.
It is caused by minification of google maps library done by webpack.
from map.
released with 0.9.1, please verify the changes
from map.
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.
It works for me,
http://plnkr.co/edit/ohwPfa3CmgZQlGeTCx2h?p=preview
You might have missed to import Polygon
from ng2-map
from map.
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)
- Marker Limit? - Error finding location for ... HOT 3
- For development purposes only HOT 1
- How to achieve navigation for a given route?
- How to only refresh the markers on map without refreshing the whole map..?
- Problem with adding a new component with svg HOT 2
- ngui-map, error finding the location from 28.577282, 77.3264023 HOT 2
- map.setCenter doesn't do anything HOT 3
- Map doesn't respect "aria-hidden="true"
- Custom labels on Polygon or Custom labels on maps
- Error: fitBounds: latLngBounds must be of type LatLngBounds.
- mapClick and click events works like they set with useCapture on touch screen
- Cant update my map with my gps data via a mqtt channel, it complains on this "js?v=3.exp&key=&callback=initialize:63 InvalidValueError: at index 0: not a LatLng or LatLngLiteral with finite coordinates: in property lat: NaN is not an accepted value"
- Autocomplete not initialising on route change.
- Is this repo being maintained anymore? HOT 1
- How to disable "Know your location" popup?
- How to disable moving to your current location on loading?
- Source Code vs. NPM
- Error: node_modules/@ngui/map/ngui-map.module.d.ts:4:44 - error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).
- You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors. HOT 1
- How To Style Marker
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from map.