Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using angular-maps #55

Closed
MrGoogol opened this issue Dec 10, 2017 · 6 comments
Closed

Using angular-maps #55

MrGoogol opened this issue Dec 10, 2017 · 6 comments

Comments

@MrGoogol
Copy link

MrGoogol commented Dec 10, 2017

I followed the three steps in Use section and tried various things without much luck. The error code I get when trying to implement bing-maps component in my angular project is:

Uncaught Error: Template parse errors:
Can't bind to 'Latitude' since it isn't a known property of 'map-marker'.
1. If 'map-marker' is an Angular component and it has 'Latitude' input, then verify that it is part of this module.
2. If 'map-marker' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
  <x-map #xmap [Options]="_options">
      <map-marker
          [ERROR ->][Latitude]="30" 
          [Longitude]="90" 
          [Title]="'My Marker'" 
"): ng:///AppModule/BingMapComponent.html@6:10
Can't bind to 'Longitude' since it isn't a known property of 'map-marker'.

Were there additional imports necessary for bing-map component that I created?
Also I tried having the line

///<
reference path="../../../node_modules/bingmaps/types/MicrosoftMaps/Microsoft.Maps.All.d.ts" />

at the top of the bing-map component

@thor-schueler
Copy link
Contributor

thor-schueler commented Dec 10, 2017 via email

@MrGoogol
Copy link
Author

MrGoogol commented Dec 11, 2017

Maps are starting to show up. Plunker code samples helped yet I am not seeing how variable ILatLong was defined; wasn't it supposed to be coming from import of one of the libraries? (New to Angular - thankyou for helping)

There is a new error where ILatLong is not defined.
_markers: Array<ILatLong> = new Array<ILatLong>();

ERROR in src/app/bing-map/bing-map.component.ts(38,22): error TS2304: Cannot find name 'ILatLong'.

@thor-schueler
Copy link
Contributor

ILatLong is an interface type defined in angular-maps. You will have to import it before using it. Put

import { ILatLong } from 'angular-maps';

into your imports in the file where you want to use the interface.

@thor-schueler
Copy link
Contributor

@MihaelFeldman: are you good? Can I close this issue?

@MrGoogol
Copy link
Author

Getting another error when trying to use Google Maps:

Uncaught Error: Template parse errors:
Can't bind to 'Options' since it isn't a known property of 'x-map'.
1. If 'x-map' is an Angular component and it has 'Options' input, then verify that it is part of this module.
2. If 'x-map' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("<i class="fa"></i>
<div style="height: 400px; width: 960px">
    <x-map #xmap [ERROR ->][Options]="_options" [Box]="_box">
          <x-map-marker *ngFor="let m of _markers; let i=index" [L"): ng:///AppModule/GmapComponent.html@2:17
Can't bind to 'Box' since it isn't a known property of 'x-map'.

@thor-schueler
Copy link
Contributor

@MihaelFeldman it looks like you are having some basic issues with angular as opposed to the maps components. It appears that you are not importing the appropriate components in your module. Please use one of the samples in https://github.com/infusion-code/angular-maps/wiki/Samples as a go by. These are working implementation on plunker.

Alternatively, you can create a plunker that illustrates your problem and I will take a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants