Error using Reactive Maps with Google maps Javascript Api - google-maps-api-3

I am trying to build and app with ReactiveSearch and ReactiveMaps using some indexed files in Elasticsearch.
The indexed files in Elasticsearch have a field "location", for example:
"location": {
"Lat": 56.746423,
"Lon": 37.189268
}
And other fields like "Title" or "Authors".
I got a Google maps API key and in my App.js file I have these components:
<DataSearch
componentId="mainSearch"
dataField={["Title", "Title.search", "Abstract", "Abstract.search"]}
queryFormat="and"
placeholder="Search for HEP"
autosuggest={true}
className="datasearch"
innerClass={{
input: "searchbox",
list: "suggestionlist"
}}
/>
<ReactiveMap
componentId="map"
dataField="location"
size={100}
defaultZoom={13}
defaultCenter={{ lat: 37.74, lng: -122.45 }}
showMapStyles={true}
defaultMapStyle="Standard"
showMarkerClusters={true}
showSearchAsMove={true}
searchAsMove={true}
react={{
and: "mainSearch"
}}
onData={result => ({
label: result.Title
})}
/>
in the same file ("App.js") I have this lines :
<ReactiveBase
app="title"
url=here_the_elasticsearch_cluster
mapKey="here_my_googlemapsAPI_key"
>
Also in the file Public/index.html I have
<script
type="text/javascript"
src="https://maps.google.com/maps/api/js?v=3.34&key=MY_GOOGLE_MAPS_API_KEY&libraries=places"
></script>
However, When I search for any documents in the mainBar I found it, but, when I click on it it doesnt appear in the map.
What am I doing wrong?

Finally I have solved it.
ReactiveMaps does not allow the location field in uppercase, so I had to change the indexed documents in elasticsearch taking in account this.
"location": {
"lat": 56.746423,
"lon": 37.189268
}

Related

`next-sitemap` duplicated language in alternate ref path (href)

..I have a Next.js application with multi-language support (English as the default language and German as the secondary one - English is on https://mywebsite.com and German on https://mywebsite.com/de).
I'm using next-sitemap to generate a sitemap for the page using alternate refs to link the English and German versions of the pages. The following is my next-sitemap config:
/** #type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: `https://mywebsite.com`,
generateRobotsTxt: true,
exclude: ['/app/*', '/social-redirect'],
robotsTxtOptions: {
policies: [
{
userAgent: '*',
[process.env.VERCEL_ENV !== 'preview' && process.env.VERCEL_ENV !== 'development'
? 'allow'
: 'disallow']: '/',
},
],
},
alternateRefs: [
{
href: 'https://mywebsite.com',
hreflang: 'en',
},
{
href: 'https://mywebsite.com/de',
hreflang: 'de',
},
],
};
In the generated sitemap the English entries of the sitemap look good. They have the correct alternate refs. But in the German entries of the sitemap, the alternate refs have the language in the path twice, so for example: https://mywebsite.com/de/de/blog. Is this an issue of next-sitemap or am I doing something wrong? I would be glad if someone could help me with that!
This is also happening to me. I think it is an issue of next-sitemap
In my case I have languages en and en-gb The urls generated are:
<xhtml:link rel="alternate" hreflang="en" href="http://localhost:3000/en/en-gb/blog/"/>
<xhtml:link rel="alternate" hreflang="en-gb" href="http://localhost:3000/en-gb/en-gb/blog/"/>
You can use transform prop of next-sitemap.config.js to configure a replacement
`transform: async (config, path) => {
return { ...config,
loc: path.replace('/en-gb/en-gb', '/en-gb')
}
}

paypal iframe custom style

So on the website, the PayPal checkout page is implemented by using this iframe documentation, where it offers the customization on css of iframe with given css key:value pairs in JSON string. you can see that here
Now, can someone help me if I am passing the JSON string correctly, because it doesnt work for some reason. i need to make the labels white in color
<script type="application/javascript">
var styles = {
"pppLabel": {
"color": "#fff"
},
"pppCheckboxLabel": {
"color": "#fff"
}
};
var ppp = PAYPAL.apps.PPP({
"approvalUrl": "<?=$approvalUrl?>",
"placeholder": "ppplusDiv",
"payerEmail": "<?=$_POST['email']?>",
"payerFirstName": "<?=$_POST['name']?>",
"payerLastName": "<?=$_POST['surnamename']?>",
"payerPhone": "<?=$_POST['telephone']?>",
"payerTaxId": "<?=$_POST['cpf']?>",
"miniBrowser":false,
"merchantInstallmentSelection":12,
"merchantInstallmentSelectionOptional":true,
"mode": "live",
"payerTaxIdType": "BR_CPF",
"language": "pt_BR",
"country": "BR",
"css": styles,
});
I have made changes like
"css": JSON.stringify(styles)
but it doesnt work and give this in console
screenshot
code pic
web page pic
doesn't work and show some messages in console, i am adding a screenshot as an answer to my question screenshot

How to import a certain image and get the exact path (imagename) after build in Nextjs

I am using the next-seo package. How can I import an image and get the correct imagename/url in the image section?
<NextSeo
title="a certain title"
description="a certain description"
canonical="https://www.d"
openGraph={{
url: "https://www.tandartsenpraktijk-herckenrode.be",
title: "a certain title",
description: "a certain description",
images: [
{
url: "?????",
},
],
site_name: "A certain name",
}}
/>
Putting the image in the public folder was the correct answer...

Multiples instances of VideoJS playlist are deprecated

I'm developing a Wordpress Plugin that allows users to add custom video playlists to their pages or posts, and for that I'm using Videojs and Videojs Playlist libraries.
I've successfully managed to add a single playlist into a page, but when a second one is created the first player is disabled.
First Player disabled
Other problem I'm facing is that, although the vjs-playlist div is added, it only shows in the first player created.
Code display in the browser
var options = {"techOrder": ["html5","youtube", "flash"]};
var myPlayer = videojs('my-playlist-player', {options, "autoplay": false, "controls": true, "fluid": true, "liveui": true});
myPlayer.playlist([{
name: 'Test item 1 type .m3u8',
description: 'Testing for videojs-playlist-ui integration',
duration: '45',
sources: [
{src: '//vjs.zencdn.net/v/oceans.mp4',type: 'video/mp4'}
],
thumbnail: [
{
srcset: '//bcvid.brightcove.com/players-example-content/clouds-1800.jpg',
type: 'image/jpeg',
style: 'max-height: 120px;'
}
]
},{
name: resTitle,
description: resDesc,
duration: resDuration,//'45',
sources: [
{src: resItemSrc, type: resMime}
],
thumbnail: [
{
srcset: resThumbnail,
type: resImgType,
style: thumbStyle//'max-height: 120px;'
}
]
}
}
]);
console.log(myPlayer.playlist());
myPlayer.playlistUi({el: document.getElementById('vjs-playlist'), horizontal: true});
myPlayer.playlist.autoadvance(1);
I believe my errors happen because videojs functions are detecting the same id in all elements, but if so how could I avoid this?
Any other ideas or opinions on why this errors might be happening, would be great.
Thanks in advance.
A bit more of information, I wanted to check how many players the script detected and so I printed in the console the window.videojs.players and only one player is detected even if more are created. Check result
Could this be because they have the same ID? If so how could it be fixed? HTML Result

Sencha Touch 2: How do I display RSS feed as list?

I'd like to create a simple app that shows me a list of the latest stories from my favourite news sites using Sencha Touch 2 and the RSS feeds, of course.
How do I get data from an rss-feed and then display it as a list, showing title, author, date and content?
I can get a list of the latest news stories going, but I can only manage to display each item title/headline, not the author, date, snippet etc. Here's my code:
1 model, 1 store, 1 view, 1 app.js:
//The store
Ext.define("NewsApp.store.EbStore", {
extend: "Ext.data.Store",
requires: ["Ext.data.proxy.JsonP", "Ext.dataview.List" ],
config: {
model: "NewsApp.model.NewsListModel",
autoLoad: true,
proxy: {
type: 'jsonp',
url: 'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=5&q=http://feeds.feedburner.com/newsapp_pol',
reader: {
type: 'json',
rootProperty: 'responseData.feed.entries'
}
}
}
});
//The Model
Ext.define("NewsApp.model.NewsListModel", {
extend: "Ext.data.Model",
config: {
fields: [
{name: 'title', type: 'auto'},
{name: 'author', type: 'auto'},
]
}
});
//The view
Ext.define("NewsApp.view.NewsList", {
extend: "Ext.Container",
requires: "Ext.Toolbar",
alias: "widget.newslistview",
config: {
layout: {
type: 'fit'
},
items: [{
xtype: "toolbar",
title: "Danske Nyheder",
docked: "top",
items: [
{
xtype: 'spacer'
},
{
xtype: "button",
text: "Indstillinger",
ui: "action",
id: "settingsButton",
iconMask: true,
iconCls: 'settings'
},
{
xtype: "button",
text: "Refresh",
ui: "action",
id: "refreshButton",
iconMask: true,
iconCls: 'refresh'
}
]
},
{
xtype: "list",
store: "EbStore",
itemId:"EbList",
onItemDisclosure: true,
itemTpl: '{title}'
}
],
}
});
// And the app.js just for kicks
Ext.application({
name: "NewsApp",
models: ["NewsListModel"],
stores: ["EbStore"],
views: ["NewsList"],
launch: function () {
console.log("App starts");
var newsListView = {
xtype: "newslistview"
};
Ext.Viewport.add([newsListView]);
}
});
With this code, I can display the titles of the rss items nicely. But if I change the {title} to, say, {author}, the list items are created in my view, but without any content whatsoever. The RSS that I'm trying to read uses normal standards, I think: http://feeds.feedburner.com/newsapp_pol
So how do I display more than just the title and acces the rest of the rss?
I guess it boils to my not understanding what data is being captured in the proxy-code or how or in what format exactly.
Can anybody help? :-)
I have checked out these two examples of Sencha Touch RSS readers, and both are excellent, except that the code is way too advanced for me to understand:
http://www.sencha.com/apps/rssreader/
https://github.com/AndreaCammarata/FeedBurner-RSS-Reader
Troels,
If you want to look at the data response of your google feed, I suggest you take a peek at the json data with a json beautifier to make it easier to read. First paste your google feed url into the browser's address bar. Copy the resulting json response - and paste it into the beautifier. That will give you a structured view of the data fields in the response data.
When i tried it, the first entry looked like this:
"title": "Over 50 såret under kampe i Kosovo",
"link": "http://politiken.dk/udland/ECE1672568/over-50-saaret-under-kampe-i-kosovo/",
"author": "",
"publishedDate": "Thu, 28 Jun 2012 12:09:18 -0700",
"contentSnippet": "35 politifolk og 20 serbere blev såret, da en gruppe serbere stødte sammen i det etnisk delte Kosovo.",
"content": "35 politifolk og 20 serbere blev såret, da en gruppe serbere stødte sammen i det etnisk delte Kosovo.",
"categories": []
I noticed that the "author" field is empty on all entries, which may explain why you get an empty list.
That should help you understand the data structure in the feed and create matching references in your code.
Cheers,
Rasmus

Resources