Open LauraTGail opened 5 years ago
As a workaround, I found that removing the [Title]="'Title Here'"
from <x-map-polygon>
it would render the polygon correctly. Stack trace seems to show it failing inside the show tooltip code.
Could you put a quick demo of your code together on stackblitz so I can take a look and debug this? The tooltip is implemented via a mapLabel, I suspect this is a timing issue where the label has not yet been added to the map, so the getMap() function has not been added to the prototype yet (remember, bing maps is Javascript). I think simply updating bing-label.ts from
public GetMap(): Microsoft.Maps.Map {
return (<any>this).getMap();
}
to
public GetMap(): Microsoft.Maps.Map {
if(! (<any>this).getMap) return null; // or some such
return (<any>this).getMap();
}
will do the trick but want to look at it a bit closer first....
See https://github.com/infusion-code/angular-maps/tree/Issue110 as proposed fix. Will validate and publish as soon as I have your sample.
Stackblitz demo: https://stackblitz.com/edit/angular-maps-bug-example
Can you please publish the fix soon. I am getting this error. I was excited to see customStyle implementation but ran into polygon issue.
Thanks krishna
Hi
Is there a way I can do npm install --save "github:infusion-code/angular-maps#Issue110". The above command does not get any of src directory gor me to work on. I need this very urgently.
@krishtgkk Unfortunately, you cannot install from a branch, that is not possible with npm. I am planning to take a look on validating and publishing this Friday. In the meanwhile, you might use the workaround outlined above.
Hi
As suggested I have applied the fix locally. stilll getting errors as cannot set property beneathLabels of undefined. The issue is from BingMapLabel function.
Please Help.
Done some more investigation... This issue occurs because the BingMapLabel.getMap() is called before the label has been added to the map. The getMap function is dynamically added by Bing once the label has been added. This seems to be the result of dynamically creating the layers with the ngFor. Will need to investigate some more.
Further investigation shows the error was introduced with 6.0.3 by adding the Extender object to do the mixins. This does not to correctly appear to extend the prototypes of the objects with the mixed in class. This affects labels (used for tooltips) and overlays. I will need to debug this more to find the actual offending code...
Hi @thor-schueler, any update on this issue? Any there any docs for how to get started debugging the package?
Any updates on this?
Now works with Angular 8, but still getting errors for polygons.
Environment: Angular 8 "angular-maps": "6.0.3" "typescript": "3.5.3"
Issue: core.js:4002 ERROR Error: Uncaught (in promise): TypeError: this.getMap is not a function TypeError: this.getMap is not a function
Polygons are not displaying.