Jump to content

Overlaying marker images ontop of an image at coordinates


Hypnos

Recommended Posts

I have a map image that I want to place "pushpins" on. I have some concept code that mostly works (although IE is a little off), although I have to wonder if there is a better way of doing it.

 

http://www.kodb.info/map.php

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<div align="center">
<input type="button" onclick="document.getElementById('button').style.display = ''" value="Doda"><br>
<img src="elmorad.jpg" id="image">
</div>
<img src="http://www.kodb.info/greenbullet.gif" style="position: absolute; display: none;" id="button">
<script type="text/javascript">
document.getElementById("button").style.top = document.getElementById("image").offsetTop +370 + "px";
document.getElementById("button").style.left = document.getElementById("image").offsetLeft +470 + "px";
</script>
</body>
</html>

 

I'd rather not use a API or framework if I don't have to.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.