473,657 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drawing line using map coordinates

Hello all,
In my html page I want to add an image say of 800x600. Now I want that
when ever I am given two coordinates on this image say (x1, y1)=(50,
100) and (x2, y2)=(200, 300), the java script code will trace these
coordinates on the image and draw the line between these two points.
Can anyone please help me in writing the javascript code of this
problem?

Thanks and Regards
Atif
Jul 20 '05 #1
19 4804
Atif wrote:
Hello all,
In my html page I want to add an image say of 800x600. Now I want that
when ever I am given two coordinates on this image say (x1, y1)=(50,
100) and (x2, y2)=(200, 300), the java script code will trace these
coordinates on the image and draw the line between these two points.
Can anyone please help me in writing the javascript code of this
problem?


As far as I know, JavaScript has no drawing capabilities. I would
imagine that the only way you can accomplish this is using a Java
applet, or some other multimedia object like Flash.

Mike

--
Michael Winter
M.******@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

Jul 20 '05 #2
On Wed, 24 Dec 2003 15:10:26 GMT, Michael Winter
<M.******@bluey onder.co.invali d> wrote:
Atif wrote:
In my html page I want to add an image say of 800x600. Now I want that
when ever I am given two coordinates on this image say (x1, y1)=(50,
100) and (x2, y2)=(200, 300), the java script code will trace these
coordinates on the image and draw the line between these two points.
Can anyone please help me in writing the javascript code of this
problem?


As far as I know, JavaScript has no drawing capabilities.


it has no capability to do anything at really...

but javascript in SVG, or Flash, or with VML or VRML or
DirectAnimation all have great drawing abilities. I'd recommend SVG
myself.

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #3
JRS: In article <C%************ *********@news-text.cableinet. net>, seen
in news:comp.lang. javascript, Michael Winter <M.******@bluey onder.co.inv
alid> posted at Wed, 24 Dec 2003 15:10:26 :-
Atif wrote:

In my html page I want to add an image say of 800x600. Now I want that
when ever I am given two coordinates on this image say (x1, y1)=(50,
100) and (x2, y2)=(200, 300), the java script code will trace these
coordinates on the image and draw the line between these two points.
Can anyone please help me in writing the javascript code of this
problem?


As far as I know, JavaScript has no drawing capabilities. I would
imagine that the only way you can accomplish this is using a Java
applet, or some other multimedia object like Flash.


As a Rather Desperate Move, is it possible to take a graphic of a line,
say a black diagonal on a transparent 800*600 area, and scale & position
it over the existing image? Such a line, in a suitable graphical
format, should not need a large file. Several, of different sizes,
would be needed in order that the line-width would not scale into
invisibility.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 20 '05 #4
In article <PH************ **@merlyn.demon .co.uk>, Dr John Stockton
<sp**@merlyn.de mon.co.uk> writes:
JRS: In article <C%************ *********@news-text.cableinet. net>, seen
in news:comp.lang. javascript, Michael Winter <M.******@bluey onder.co.inv
alid> posted at Wed, 24 Dec 2003 15:10:26 :-
Atif wrote:

In my html page I want to add an image say of 800x600. Now I want that
when ever I am given two coordinates on this image say (x1, y1)=(50,
100) and (x2, y2)=(200, 300), the java script code will trace these
coordinates on the image and draw the line between these two points.
Can anyone please help me in writing the javascript code of this
problem?


As far as I know, JavaScript has no drawing capabilities. I would
imagine that the only way you can accomplish this is using a Java
applet, or some other multimedia object like Flash.


As a Rather Desperate Move, is it possible to take a graphic of a line,
say a black diagonal on a transparent 800*600 area, and scale & position
it over the existing image? Such a line, in a suitable graphical
format, should not need a large file. Several, of different sizes,
would be needed in order that the line-width would not scale into
invisibility .


<URL: http://members.aol.com/_ht_a/hikksno...hit/index.html />

Is a page that I made a while back that does about what the OP wanted. It uses
divs and a 1x1 image and moves them between the points to create the line. That
one is 400 pixels wide and when it gets larger, it gets slower. Wouldn't be
hard to adapt it to work in IE4 as well, I know it works in IE5+, NS6+ and
Opera.

--
Randy
Jul 20 '05 #5
DU
Atif wrote:
Hello all,
In my html page I want to add an image say of 800x600. Now I want that
when ever I am given two coordinates on this image say (x1, y1)=(50,
100) and (x2, y2)=(200, 300), the java script code will trace these
coordinates on the image and draw the line between these two points.
Can anyone please help me in writing the javascript code of this
problem?

Thanks and Regards
Atif

As others mentioned, this is best done with SVG. SVG has all the
capabilities and more (much more) to satisfy your requirements.

DU
Jul 20 '05 #6
DU <dr*******@hotW IPETHISmail.com > writes:
As others mentioned, this is best done with SVG. SVG has all the
capabilities and more (much more) to satisfy your requirements.


Which browsers support SVG?

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #7
On Thu, 25 Dec 2003 12:36:10 +0100, Lasse Reichstein Nielsen
<lr*@hotpop.com > wrote:
DU <dr*******@hotW IPETHISmail.com > writes:
As others mentioned, this is best done with SVG. SVG has all the
capabilities and more (much more) to satisfy your requirements.


Which browsers support SVG?


There's no browsers with good native support other than X-Smiles, but
with that not having any HTML capability... (Mozilla's SVG has good
support for some parts, and Konq in KDE 3.2 ships with KSVG, but it
doesn't do mixed namespace stuff.)

Mainly it's plugin based such as Adobe SVG Viewer, for Mac/Win/Linux ,
or Corel's SVG Viewer for Windows. There are also X-Smiles and DENG
of the XML family, but they're a bit impractical for proper users.

There's also Batik's Squiggle an excellent standalone java browser.

Most people will have ASV 3, normally you would include it in a page
with IFRAME or OBJECT, and script it internally.

Safari, Opera, IE, Gecko family on Win/Mac all go okay with asv3
(although you'll need the 3.01 ASV release for Gecko family), on Linux
the 3.01 release will give you Konqi and Gecko support, although there
are some limitations - no sound for example - there's no non-GPL
common sound library on linux I believe.

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #8
On Thu, 25 Dec 2003 12:36:10 +0100, Lasse Reichstein Nielsen
<lr*@hotpop.com > wrote:
DU <dr*******@hotW IPETHISmail.com > writes:
As others mentioned, this is best done with SVG. SVG has all the
capabilities and more (much more) to satisfy your requirements.


Which browsers support SVG?


http://jibbering.com/svg/whiteboard/
and
http://jibbering.com/svg/AnnotateImage.html

are examples which roughly do what the OP wants aswell.

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #9
DU
Dr John Stockton wrote:
JRS: In article <bs**********@n ews.eusc.inter. net>, seen in
news:comp.lang. javascript, DU <dr*******@hotW IPETHISmail.com > posted at
Wed, 24 Dec 2003 21:48:37 :-
Atif wrote:
In my html page I want to add an image say of 800x600. Now I want that
when ever I am given two coordinates on this image say (x1, y1)=(50,
100) and (x2, y2)=(200, 300), the java script code will trace these
coordinate s on the image and draw the line between these two points.
Can anyone please help me in writing the javascript code of this
problem?


As others mentioned, this is best done with SVG. SVG has all the
capabilitie s and more (much more) to satisfy your requirements.

Such a recommendation is better accompanied by an indication of where to
seek more information, and what is required to run SVG.

Google.com, searching for svg newsgroups, etc... was a start. I was in
no way preventing the original poster to ask back for more clues, hints,
etc. on how to achieve what he wants with SVG. My post was not imposing
any implicit constraint.

FWIW, the Adobe SVG plugin is a good place to start. As mentioned by Jim
L., Mozilla can now make use of the Adobe SVG plugin (this is very
recent news: http://bugzilla.mozilla.org/show_bug.cgi?id=133567#c67 ).

http://www.adobe.com/svg/viewer/install/

DU
I have no recollection of the term, and suspect that SVG may not be
available to me.

Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
12997
by: Remon Huijts | last post by:
Hi there, For a very specific service, I have created a PHP script that uses the GD library functions to create a PNG image from a few lines of XML data describing a simple diagram/drawing. It's cool and works, writing the XML data in a text editor is straightforward for me because I designed the format. I have no idea however how I can make a simple online drawing program that creates this XML code. The code is realy simple, just...
6
8153
by: johannblake | last post by:
I am wondering whether it is easy to setup a coordinate system for drawing (using GDI+) that uses meters (or any custom scaling for that matter). Currently, I need to convert from pixels to meters for scaling. This can sometimes get rather complex when you need to take scaling into account or other things like window resizing, scrolling, etc. There is a property called PageUnit which can be set to World. I could not find any examples...
2
1431
by: Martin Horn | last post by:
Hi all, I'm adding basic drawing capability to an application that I am writing, and I have been having problems with making the graphics output persist when the application is re-sized,covered etc. This is the solution I have come up with, but it seems a bit convoluted. Before I get too far into the development of the program, could someone cast an eye over my code and tell me if I have approached it in the correct way, or suggest a...
4
12311
debasisdas
by: debasisdas | last post by:
This article contains the basic syntax to draw graphics of various shapes and sizes in Visual Basic 6.0. Different types of geometrical shapes (rectangle, square, circle, arc, ellipse etc.) can be drawn on the form by using the following syntax. Basic syntax (for line, rectangle, square) ============================= OBJECT.LINE (X1, Y1) -(X2, Y2), , ] STEP -- KEYWORD SPECIFYING THAT THE STARTING POINT COORDINATES ARE RELATIVE TO THE...
2
10208
by: CyberSoftHari | last post by:
I am drawing a line for X, Y Z coordinates and I want to display lines in color. How can in draw? Below code display only white line. // Variables VertexPositionColor pointList; //Init Points for lines pointList = new VertexPositionColor; pointList = new VertexPositionColor(new Vector3(0, 0, 0), Color.Red); pointList = new VertexPositionColor(new Vector3(0.5f, 0, 0), Color.Red); ..................
0
1393
by: emilnordiclake | last post by:
(C#, Microsoft .NET Framework 3.5) Hello! I'm in the process of creating a custom text control and I want to add functionality for superscripts and subscripts. I'm using TextRenderer for drawing and measuring text because Graphics.DrawString and Graphics.MeasureString does not come with a "NoPadding" option. When drawing superscripts and subscripts, I'll specify the x-position as the width of the normal text. This works fine for regular...
5
12868
by: Macias | last post by:
Hi, Please help me, how I can make a line drawing on PictureBox similar to MS paint. I thinking about this: click and hold button, move mouse and relase button. I'm trying useing this g.DrawLine(..), but I have a lot of line. In C++ is a parameter XORPUT, but in C# I can't find it.
5
3579
by: Dave Bootsma | last post by:
I have an application where I want to redraw a polygon from points I retrieve from a file. The file is read with streamreader line by line each line contains the points for each polygon. Below is a typical line from my file. 500,748 500,678 552,678 552,696 584,696 584,714 612,714 612,748 Each set of x,y coordinates is separated by a space. How can I read this into my points collection. If I currently try I get
7
3550
by: raylopez99 | last post by:
I have a logical drawing space much bigger than the viewport (the screen) and I'd like to center the viewport (the screen) to be at the center of the logical drawing space. After following the excellent transforms specified on Bob Powell's site, I still wonder if there's an easier way of centering it than the following procedure? Here is what I do now (it's awkward but it works): 1) I follow the transforms specified on Bob Powell's...
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7324
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.