Click here to Skip to main content
14,693,741 members
Home » Discussions » JavaScript
   

JavaScript

 
AnswerRe: Matrix creation using array Pin
Richard MacCutchan15-May-20 23:17
mveRichard MacCutchan15-May-20 23:17 
QuestionFrom PHP to Javascript Pin
Member 1482984612-May-20 5:18
MemberMember 1482984612-May-20 5:18 
AnswerRe: From PHP to Javascript Pin
Andre Oosthuizen26-May-20 2:30
MemberAndre Oosthuizen26-May-20 2:30 
QuestionJavaScript string printing. Pin
c0d3r1/29-May-20 20:24
Memberc0d3r1/29-May-20 20:24 
AnswerMessage Closed Pin
15-May-20 7:16
MemberMember 1340332915-May-20 7:16 
QuestionMacID,SystemOs, System Version and computername using javascript Pin
rangaraghavan9-May-20 8:46
Memberrangaraghavan9-May-20 8:46 
AnswerRe: MacID,SystemOs, System Version and computername using javascript Pin
Richard MacCutchan9-May-20 22:41
mveRichard MacCutchan9-May-20 22:41 
Questionadding markers to the map reactjs Pin
dcielak21-Apr-20 12:10
Memberdcielak21-Apr-20 12:10 
I would like to add a marker to the map using the form. Can anyone help me? Installing the map works. I want to display markers after entering x and y, and read this data from the table. I have 2 inputs, one for X and the other for Y after clicking "add" I add this data to the table and I have 2 objects, etc ... but only one marker from state.items is displayed on the map, although I have more coordinates in the table.I know that the componentDidMount () method is only run once and here is the problem.Please Help
state={
items:[{
      "X": 13.6155611,
      "Y": 51.0331258
    },
    ],
}
 
 addItem = (e) => {
    e.preventDefault();
    const newItem = {
      "Y": parseFloat(this.state.X),
      "X": parseFloat(this.state.Y),
    };
    this.setState(prevState => ({
      items: [...prevState.items, newItem]
    }));
 
  }
componentDidMount() {
    const map = new mapboxgl.Map({
      container: this.mapContainer,
      center: [this.state.lng, this.state.lat],
      zoom: this.state.zoom,
    });
for (var i = 0; i < this.state.items.length; i++) {
      var obj = this.state.items[i];
      let myLatlng = new mapboxgl.LngLat(obj.X, obj.Y);
      new mapboxgl.Marker()
        .setLngLat(myLatlng)
        .addTo(map);
    }
 
}
 
 render() {
    return (
        <div ref={el => this.mapContainer = el} />
 
<form onSubmit={this.addItem}>
 <input
              type="number"
              value={this.state.X}
              onChange={e => this.setState({
                X: e.target.value
              })}
            />
            <input
              value={this.state.Y}
              onChange={e => this.setState({
                Y: e.target.value
              })}
            />
</Form>
)}

Questioncan i use the bootstrap table with datatables ? Pin
Ask SNB20-Apr-20 21:19
MemberAsk SNB20-Apr-20 21:19 
SuggestionRe: can i use the bootstrap table with datatables ? Pin
Richard MacCutchan20-Apr-20 23:03
mveRichard MacCutchan20-Apr-20 23:03 
AnswerRe: can i use the bootstrap table with datatables ? Pin
ZurdoDev21-Apr-20 2:41
mveZurdoDev21-Apr-20 2:41 
AnswerRe: can i use the bootstrap table with datatables ? Pin
Jin Vincent Necesario21-Apr-20 3:17
professionalJin Vincent Necesario21-Apr-20 3:17 
Questionusing javascript geoplugin to geolocalize Pin
Member 1480782320-Apr-20 6:45
MemberMember 1480782320-Apr-20 6:45 
QuestionRe: using javascript geoplugin to geolocalize Pin
Richard MacCutchan20-Apr-20 6:57
mveRichard MacCutchan20-Apr-20 6:57 
AnswerRe: using javascript geoplugin to geolocalize Pin
Member 1480782320-Apr-20 7:37
MemberMember 1480782320-Apr-20 7:37 
GeneralRe: using javascript geoplugin to geolocalize Pin
Richard MacCutchan20-Apr-20 7:52
mveRichard MacCutchan20-Apr-20 7:52 
GeneralRe: using javascript geoplugin to geolocalize Pin
Member 1480782320-Apr-20 8:45
MemberMember 1480782320-Apr-20 8:45 
GeneralRe: using javascript geoplugin to geolocalize Pin
Richard MacCutchan20-Apr-20 22:37
mveRichard MacCutchan20-Apr-20 22:37 
AnswerRe: using javascript geoplugin to geolocalize Pin
ZurdoDev20-Apr-20 7:45
mveZurdoDev20-Apr-20 7:45 
GeneralRe: using javascript geoplugin to geolocalize Pin
Member 1480782320-Apr-20 7:52
MemberMember 1480782320-Apr-20 7:52 
GeneralRe: using javascript geoplugin to geolocalize Pin
ZurdoDev20-Apr-20 8:08
mveZurdoDev20-Apr-20 8:08 
GeneralRe: using javascript geoplugin to geolocalize Pin
Member 1480782320-Apr-20 8:43
MemberMember 1480782320-Apr-20 8:43 
AnswerRe: using javascript geoplugin to geolocalize Pin
layarfilm215-May-20 4:01
Memberlayarfilm215-May-20 4:01 
QuestionSuper simple for everyone else... Pin
JaHowler17-Apr-20 13:49
MemberJaHowler17-Apr-20 13:49 
AnswerRe: Super simple for everyone else... Pin
Jin Vincent Necesario17-Apr-20 20:35
professionalJin Vincent Necesario17-Apr-20 20:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.