-
Notifications
You must be signed in to change notification settings - Fork 0
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
Keyed Info Window Template support #4
Comments
Hi, The Kyed template doesn't work since NS 7 and I did not have the time to investigate it, but try to set it from the js side. I didi not try it but you can try with those property exposed to the maps public infoWindowTemplate: string | Template;
public infoWindowTemplates: string | Array<KeyedTemplate>; marker.infoWindowTemplates = `<template key="testWindow">
<StackLayout orientation="vertical" width="160" height="160" >
<Image src="res://icon" stretch="fill" height="100" width="100" className="infoWindowImage" />
<Label text="Let's Begin!" className="title" />
</StackLayout>
</template>`; |
@kefahB - as always, thanks for the prompt response. Given that mine is a JavaScript project, what should I add to (presumably) map-page.js? |
Yes |
To be more specific:
is TypeScript, and is not valid in my JavaScript project. I receive |
You wont use those, you will use them from marker.infoWindowTemplates = `<template key="testWindow">
<StackLayout orientation="vertical" width="160" height="160" >
<Image src="res://icon" stretch="fill" height="100" width="100" className="infoWindowImage" />
<Label text="Let's Begin!" className="title" />
</StackLayout>
</template>`;
// THEN TRY TO ADD YOUR TEMPLATE
marker.infoWindowTemplate = 'testWindow'; Like I sed, I imagine how it does work and I didn't tested it |
Ah, I understand. I'll play with this and let you know how it goes. Thanks again. |
OK, the good news is that the info window is shown for each type of template. The less-than-good news is that none of the formatting from the .scss file is applied, which would be expected I suppose given we're assigning the template text directly. This is good enough to keep me going but I'm hoping that keyed info window templates is something you can add in the coming weeks. I'll be glad to help with this, at least with the testing. |
@dlcole I'll try to bring a little time to do some stuff on this but I have also a lot of migrations to do and have my business also :) |
@kefahB Any progress on this issue? I'll need to publish my app next month and it would be really great if this could be working. Is there anything I can contribute on my end? |
I investigated this further and got it working. The dapriett version of this plugin includes this warning:
I followed that example but for keyed info window templates:
This now lets me access and format the various info windows as desired. So, you can use keyed info window templates, you just have to specify them in the mapReady event handler. As such, I'll close this issue. |
The dapriett version of this plugin supports keyed info windows, as described in the associated readme:
This text is excluded from this repository's readme, and when I attempt to load my map page (which includes such templates) I get the error,
Can keyed info window templates be supported? It would be a big deal if they're not.
The text was updated successfully, but these errors were encountered: