Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8067973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:30:35+00:00 2026-06-05T12:30:35+00:00

I am currently new to open layers. And I am having trouble on using

  • 0

I am currently new to open layers. And I am having trouble on using mouseover event with the use of jquery. I used jquery to create a tooltip, this tooltip will output coordinates from the map. Here’s my example.

<?php
 $init = "
map.events.register('mouseover', map, function (e) {
 var lonlat = map.getLonLatFromViewPortPx(e.xy);
 var selMinX=lonlat.lon-sizeSelection;
 var selMaxX=lonlat.lon+sizeSelection;
 var selMinY=lonlat.lat-sizeSelection;
 var selMaxY=lonlat.lat+sizeSelection;

 alert(e.pageX); // Showing the event.pageX isn't working.
     alert(selMinX); // Showing also one of the variables above isn't working.
 alert('hello'); // This msgbox works.

$(document).ready( function() {
        // Obviously I need to comment the mouseover function here 
        // since I am already using the mouseover event.
    // $('#map').mouseover(function(e) { 
       $('<div id='tooltip'><input type='text' id='coor'/></div>').appendTo('body');
    // });
});
});
        ";

?>

Right now, my map isn’t showing because I think there is something wrong with the code that append the tooltip to the body section. What I want to achieve here is to display the div with an input box on the document.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:30:37+00:00Added an answer on June 5, 2026 at 12:30 pm

    You need to change the quotations on the tooltip append:

     $("<div id='tooltip'><input type='text' id='coor'/></div>").appendTo('body');
    

    Please note that the first and last quote of the first selector are double quotes. The attributes are quoted with single quotes.

    I don’t know php but I assume you need to escape the quote like this or however php does it:

    $(\"<div id='tooltip'><input type='text' id='coor'/></div>\").appendTo('body');

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently new into client-side programming, especially using the Jquery Ajax method to call
Is it possible to use asp:LinkButton without JavaScript to open new windows? Currently i
I'm new to using open ID and I have downloaded the LightOpenID framework. Currently
I currently use a google map and create tiles for it by using a
I am using the following code to open a new Activity from my current
I'm currently planning a new web project. Clients are going to connect using a
I'm currently successfully displaying multiple layers using OpenLayers (Vector and WMS). My application allow
This is the code i'm currently using: (note - %s is replaced on the
currently I am using ListActivity. I use a cursor to get the data from
I'm currently building a new app based on a legacy database. In the app,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.