I want to draw circle and polygons on react native maps
here is video. this is How I want to show it.
https://youtube.com/shorts/6n7F8w6OMpQ?feature=share
Please help How Can I do it in react native without webView
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
Category Added in a WPeMatico Campaign
I want to draw circle and polygons on react native maps
here is video. this is How I want to show it.
https://youtube.com/shorts/6n7F8w6OMpQ?feature=share
Please help How Can I do it in react native without webView
I have a span tag which looks like this. This has some jquery elements with it
<span data-show="9.032979" data-duration="8.706577"><span data-begin="9.032979" data-dur="2.201314">A-tisket a-tasket </span><span data-begin="11.234293" data-dur="2.163361">A green and yellow basket </span><span data-begin="13.397654" data-dur="2.284812">I wrote a letter to my love </span><span data-begin="15.682466" data-dur="2.05709">And on the way I dropped it, </span></span><span data-show="17.739556" data-duration="8.744531"><span data-begin="17.739556" data-dur="2.216496">I dropped it, I dropped it, </span><span data-begin="19.956052" data-dur="2.193723">And on the way I dropped it. </span><span data-begin="22.149775" data-dur="2.148179">A little boy he picked it up </span><span data-begin="24.297954" data-dur="2.186133">And put it in his pocket. </span></span><span data-show="35.236208" data-duration="8.714168"><span data-begin="35.236208" data-dur="2.186133">A-tisket a-tasket </span><span data-begin="37.422341" data-dur="2.186133">A green and yellow basket </span><span data-begin="39.608474" data-du
Scenario I’m working on , this span contains a rhyme. and I have an audio for the rhyme. I want to animate the rhyme text along with the audio. Duration and when the animation begin is inside the span tag as data-duration and data-begin respectively. How can I animate the values of span tag with the data-duration of span tag in Flutter.
after adding a property in my test file the following error is showing while exectution
An error was thrown in afterAll
Error: Uncaught (in promise): RangeError: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
i saw in web the answer they are showing is there may be a recursive function in your ts file ,but that is not the case there , i also make sure that i am using the current version of google chrome.
I just started nuxtjs today and I already can’t seem to render the template on my localhost, is something wrong?
<template>
<div>
<h1>Hi</h1>
</div>
</template>
<script>
export default {
name: 'IndexPage'
}
</script>
I am trying to detect if the tip of thumb and index finger has touched each other. But I am not sure if I am doing this correctly.
const hand = result.multiHandLandmarks[0]; //Returns {x,y,z} of each landmark.
//hand[4] is the tip of the thumb - Returns {x,y,z} of the tip of thumb.
//hand[8] is the tip of the index finger - Returns {x,y,z} of the tip of index finger.
//I don't know exactly if I am doing this right to get the distance between two tip of fingers.
const x = hand[4].x - hand[8].x;
const y = hand[4].y - hand[8].y;
const z = hand[8].z;
const distance = Math.sqrt(x * x + y * y);
const element = document.getElementById("card")
//--Here I want to check if the user's index and thumb finger is touching each other.
//if it is, then move the element based on the position of index finger.
I have tried doing it this way, but it seems like not the best way to do it.
//I'm not sure about 0.045, if it's enough distance to detect a touch between two finger.
if (distance <= 0.045) {
element.style.left = `${indexFinger.x - element.offsetWidth / 2}px`;
element.style.top = `${indexFinger.y - element.offsetHeight / 2}px`;
console.log("grabbing");
} else {
console.log("NOT Grabbing", distance, z);
}
Also I want to consider the Z position of index finger, if the hand is too close to the camera, then I want to popup some alert to notify the user to move his hand away in a perfect position. Because I think, the X and Y depends on the Z position. If a hand is too close to the camera the x and y returns higher number.
How can I fix this? I have no idea what event loops, promises, async or await are. You can send me a link to an explanation, or just write me an explanation. However, this is not the main issue. The issue is that I am trying to get firebase data in a function starting on line 38, and I am getting [Object object] instead of the data. But, if I look into the firebase console, it’s giving me [Object Promise] Here is the code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<p id="i"></p>
<script type="module">
// Import the functions you need from the SDKs you need
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.6.7/firebase-app.js";
import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.6.7/firebase-analytics.js";
import { getDatabase, ref, set, get, child} from "https://www.gstatic.com/firebasejs/9.6.7/firebase-database.js";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyCnfB3Tfu9bo7PyEvhB1ZAPBbit7ZWm9D8",
authDomain: "square-1cdce.firebaseapp.com",
projectId: "square-1cdce",
storageBucket: "square-1cdce.appspot.com",
messagingSenderId: "82191280296",
appId: "1:82191280296:web:45e62faffbb7e8a94cfa9d",
measurementId: "G-NT53HS3WE9"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
const db = getDatabase()
const dbRef = ref(getDatabase());
var data={};
var x=prompt("Message:")
get(child(dbRef, "text")).then((snapshot) =>function(){
if (snapshot.exists()) {
data=snapshot.val()
} else {
data="No data available"
}
}).catch((error) => {
console.error(error);
});
set(ref(db, 'text/'), {
texts: get(ref(db, 'text/'))+"<br>"+x
});
document.getElementById("i").innerHTML= data;
</script>
</body>
</html>
Ps. I am a ten-year-old learning javascript. My father signed me up for classes.
Pss. I made the read and write values in the rules true, so anybody can change the data with this code.
Psss. Pressing on “run code snippet” will not work. You would have to run this code from an IDE.
let specificSuffix = function(words, suffix) {
if (!Array.isArray(words)) {
return [];
}
return words.filter(function(word){
return word.endsWith(suffix)
});
}
console.log(specificSuffix(['family', 'hound', 'catalyst', 'fly', 'timidly', 'bond'], 'ly'));
// [ 'family', 'fly', 'timidly' ]
console.log(specificSuffix(['simplicity', 'computer', 'felicity'], 'ily'));
// [ ]
I’m confused specifically about:
return words.filter(function(word) {
return word.endsWith(suffix)
});
}
How am I returning both of these things? The filter is saying, return this empty new array, fill it with the words that endWith the suffix… (I think)
It’s really just the two returns that are throwing me. How does this work?
I have been trying to create a website using HTML and CSS by watching a tutorial. As in the tutorial they have their Navigation bar and background blended in I did everything the same as their code except for a few pictures but my nav bar has a sharp outline which is pretty visible
I’m just learning HTML and CSS so any help is appreciated. Thanks!
*{
margin: 0;
padding: 0;
}
.navbar{
display: flex;
align-items: center;
justify-content: center;
position: sticky;
top: 0;
cursor: pointer;
}
.nav-list{
width: 50%;
align-items: center;
display: flex;
}
.nav-list li{
list-style: none;
padding: 20px 30px;
}
.nav-list li a{
text-decoration: none;
color: white;
}
.nav-list li a:hover{
text-decoration: none;
color: blue;
}
.rightNav{
width: 50%;
text-align: right;
}
.logo{
width: 20%;
display: flex;
justify-content: center;
align-items: center;
}
.logo img
{
width: 35%;
border: 3px solid white;
border-radius: 50px;
}
#search{
padding: 5px;
font-size: 17px;
border: 2px solid goldenrod;
border-radius: 9px;
}
.background{
background: rgba(0, 0, 0, 0.7) url(/img//back.jpg) ;
background-size: cover;
background-blend-mode: darken;
}
.box-main{
display: flex;
justify-content: center;
align-items: center;
color: white;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
max-width: 50%;
margin: auto;
height: 80%;
}
.firsthalf{
width: 80%;
display: flex;
justify-content: center;
flex-direction: column;
}
.sndhalf{
width: 30%;
}
.firstsection{
height: 100vh;
}
.sndhalf img{
width: 200px;
height: 200px;
border-radius: 50%;
overflow: hidden;
/* width: 60%;
border: 4px white;
border-radius: 150px; */
display: block;
margin: auto;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/style.css">
<title>ABCD</title>
</head>
<body>
<nav class="navbar background">
<ul class="nav-list">
<div class="logo"><img src="img/logo" alt="logo"></div>
<li><a href="#home">home</a></li>
<li><a href="#about">about</a></li>
<li><a href="#Services">Services</a></li>
<li><a href="#Contact_us">contact Us</a></li>
</ul>
<div class="rightNav">
<input type="text" name="search" id="search">
<button class="btn btn-sm">search</button>
</div>
</nav>
<section class="background firstsection">
<div class="box-main">
<div class="firsthalf">
<p class="big-text">big text</p>
<p class="small-text">small text</p>
Continuing from previous question
This code recodes the last edited data from Spreadsheet A Sheet1 into the same Spreadsheet A Sheet2, but I want that data (Spreadsheet A Sheet1) to be added into another Spreadsheet B Sheet2
I couldn’t configure how to modify the code since it looks a little complex to me.
Can you please help me to modify this code?
function onEdit(e) {
const range = e.range;
const sheet = range.getSheet();
if (sheet.getSheetName() != "Sheet1" || range.rowStart == 1) return;
const col = range.columnStart - 1;
const [header, ...values] = sheet.getDataRange().getDisplayValues();
const value = values[range.rowStart - 2];
const v = [[`${value[0]} - ${value[1]}`, `${header[col]} - ${value[col]}`]];
e.source.getSheetByName("Sheet2").getRange("A2:B2").setValues(v);
}
I’m trying to extract the value of this variable which is in a string along with other Javascript. Any help to get beyond where I’m at would be very helpful!
...
const someObject = {
name: 'About Us',
objectProp: [{
type: 'text',
default: {
value: 'Hey there'
}
}]
permissions: [],
position: 'relative',
breakpoints: [],
slots: [],
}
...
This gets me close but terminates at the first }
under value: 'Hey there'
(?<=someObject[s?]*[=][s?]*)({[sS]*?})
TASK
Create an SPA (Single Page App) for the following task. You can use HTML5/CSS3/JS and JS frameworks like react, vue or angular to implement the same.
i have a problem, when trying to create a new field in mongoose aggregate.
when I try to convert a number to a string. where the number has digits 15 and above.
but the result of adding the string e+15
{
$addFields: {
stringCode: {$toString : "$number_code"}
}
},
{
$lookup: {
from: "member",
localField: "number_code", //string
foreignField: "stringCode", // intiger to string
as: "member",
},
}
the example number I’m trying to change is 123456789123456
and the result is “stringCode”: “1.2345e+15”
I hope the result is “123456789123456”
I am working on a website where I have parent components and child components. The snippet below is a Google Map wrapper and a map component.
import React, { useEffect, useState, useRef } from "react";
// reactstrap components
import { Card, Container, Row } from "reactstrap";
// core components
import Header from "components/Headers/Header.js";
import LocationSearchInput from "../../components/Places";
import { useAuthenticator } from "@aws-amplify/ui-react";
import * as queries from "../../graphql/queries";
import { API, graphqlOperation } from "aws-amplify";
import { geocodeByAddress, getLatLng } from "react-places-autocomplete";
import * as _ from "lodash";
import { collapseTextChangeRangesAcrossMultipleVersions } from "typescript";
const MapWrapper = (data, loc) => {
const mapRef = useRef(null);
console.log("child props", data, loc);
console.log("foo child", loc);
// THIS WONT WORK BECAUSE WHEN IT FIRST LOADS ITS EMPTY
// geocodeByAddress(loc[0].HomeLocation)
// .then(results => getLatLng(results[0]))
// .then(latLng => console.log('Success', latLng))
// .catch(error => console.error('Error', error))
useEffect(() => {
console.log("child mount");
let google = window.google;
let map = mapRef.current;
let lat = "40.748817";
let lng = "-73.985428";
const myLatlng = new google.maps.LatLng(lat, lng);
const mapOptions = {
zoom: 12,
center: myLatlng,
scrollwheel: false,
zoomControl: true,
styles: [
{
featureType: "administrative",
elementType: "labels.text.fill",
stylers: [{ color: "#444444" }],
},
{
featureType: "landscape",
elementType: "all",
stylers: [{ color: "#f2f2f2" }],
},
{
featureType: "poi",
elementType: "all",
stylers: [{ visibility: "off" }],
},
{
featureType: "road",
elementType: "all",
stylers: [{ saturation: -100 }, { lightness: 45 }],
},
{
featureType: "road.highway",
elementType: "all",
stylers: [{ visibility: "simplified" }],
},
{
featureType: "road.arterial",
elementType: "labels.icon",
stylers: [{ visibility: "off" }],
},
{
featureType: "transit",
elementType: "all",
stylers: [{ visibility: "off" }],
},
{
featureType: "water",
elementType: "all",
stylers: [{ color: "#5e72e4" }, { visibility: "on" }],
},
],
};
map = new google.maps.Map(map, mapOptions);
const marker = new google.maps.Marker({
position: myLatlng,
map: map,
animation: google.maps.Animation.DROP,
title: "Light Bootstrap Dashboard PRO React!",
});
const contentString =
'<div class="info-window-content"><h2>Light Bootstrap Dashboard PRO React</h2>' +
"<p>A premium Admin for React-Bootstrap, Bootstrap, React, and React Hooks.</p></div>";
const infowindow = new google.maps.InfoWindow({
content: contentString,
});
google.maps.event.addListener(marker, "click", function () {
infowindow.open(map, marker);
});
}, []);
console.log("child render");
return (
<>
<div
style={{ height: `600px` }}
className="map-canvas"
id="map-canvas"
ref={mapRef}
></div>
</>
);
};
const Maps = () => {
const [foo, setFoo] = useState([]);
const { user, signOut } = useAuthenticator((context) => [context.user]);
// console.log("user map", user);
const [pin, setPin] = useState([]);
const fetchFoo = async () => {
console.log(user.attributes.email);
try {
const todoData = API.graphql(
graphqlOperation(queries.listEmployees, {
filter: {
Email: {
eq: user.attributes.email,
},
},
})
).then((response) => {
console.log("fetch resp", response);
setFoo(response.data.listEmployees.items);
})
.catch((err) => {
console.log(err);
});
} catch (err) {
console.log("error facing Todos:", err);
}
};
console.log("parent render");
useEffect(() => {
console.log("parent mount")
fetchFoo();
}, []);
var json = [{a: "a", b:"b"}]
return (
<>
<Header />
{/* Page content */}
{/* {foo} */}
<Container className="mt--7" fluid>
<Row>
<div className="col">
{/* <LocationSearchInput /> */}
</div>
</Row>
<Row>
<div className="col">
<Card className="shadow border-0">
{/* <> */}
<MapWrapper data={json} loc={{foo}}/>
{/* </> */}
</Card>
</div>
</Row>
</Container>
</>
);
};
export default Maps;
The child component when it first reads the data it is empty but it is populated the second time it is loaded. I have tried to tweak the useEffect to work but the only difference I get is it’ll perform an infinite loop if I remove the empty array.
I’m using a nocode API that returns some HTML based on some parameters in the URL when the user makes a GET request. I’d like to improve the user experience and have a form like a contact 7 form that can map user input for each form field in the call to API.
For example form would look like following:
Name: Todd
Email: [email protected]
Key: zjdHSDFHSDFHSDFS
My API is example https://api.com/endpoint/v1/
When the user enters name, email and key I need to make a call like this:
My API is example https://api.com/endpoint/v1?name={name}&email={email} with the Key field passed in as a header (X-BLOBR-KEY: {key})
I couldn’t figure out how to do this with javascript or with a wordpress plugin.
I am using swup.js with a Laravel project that also uses Livewire. I almost have it working right, but I’m getting a bizarre error.
Here’s the situation:
I can’t figure out why this is happening. Here is my setup + code:
app.js
:
import Swup from 'swup';
import SwupScriptsPlugin from '@swup/scripts-plugin';
import SwupLivewirePlugin from '@swup/livewire-plugin';
const swup = new Swup({
cache: false,
debugMode: true,
plugins: [
new SwupLivewirePlugin(),
new SwupScriptsPlugin({
head: true,
body: true,
optin: true
}),
]
});
My master blade template, layouts.app.blade.php
:
...
<livewire:scripts />
<main id="swup" class="">
@yield('content')
<script data-swup-ignore-script src="{{ asset('js/app.js') }}"></script>
@yield('js')
</main>
...
My home.blade.php
file:
@extends('layouts.app')
@section('content')
<section class="mt-24 mb-32 py-12 relative">
<div class="max-w-7xl mx-auto px-4">
<div class="flex flex-col space-y-3 lg:w-1/2 w-full ml-auto">
<span class="block text-3xl xl:inline">I'm a...</span>
<span id="role" class="block text-indigo-600 xl:inline text-7xl">Hymn Writer</span>
</div>
</div>
</div>
</div>
</section>
@endsection
...
@section('js')
<script data-swup-reload-script src="https://cdnjs.cloudflare.com/ajax/libs/TypewriterJS/2.17.0/core.min.js" integrity="sha512-o6alMAMTI5qAmVC1UvuRPgTl3UOOkP8NZ6212+rq1Oslsuy8Owt9r5Z0Wu0LNxpw/Q8N8ToGiyovHV+kyOulxg==" crossorigin="anonymous"></script>
<script data-swup-reload-script>
function init() {
var role = document.getElementById('role');
var typewriter = new Typewriter(role, {
loop: false,
});
typewriter.typeString('Hymn Writer')
.pauseFor(2400)
.deleteAll()
.typeString('Father')
.pauseFor(2400)
// ...etc
.start();
}
init();
document.addEventListener('swup:contentReplaced', init);
</script>
@endsection
I can’t figure out why it’s working on initial page load and subsequent link clicks but not the very first time the link is clicked when starting from another page? What is going on here?