javascript - Openlayers add custom div above map -
i'm newbe here. have map (osm) openlayers. tryed add measure tools. i'm using example http://openlayers.org/dev/examples/measure.html need move buttons on map scaleline.
i've tryed code
document.getelementbyid("map").innerhtml += '<div id="options" style="position: absolute;z-index: 10000;bottom: 0px;left: 100px;"><input type="radio" name="type" value="none" id="nonetoggle" onclick="togglecontrol(this);" checked="checked" /><label for="nonetoggle"> nav</label><input type="radio" name="type" value="line" id="linetoggle" onclick="togglecontrol(this);" /><label for="linetoggle"> measure </label> <span id="output"></span></div>' but make map freeze. page map looks
<html xmlns="http://www.w3.org/1999/xhtml"> <head> ... <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <body> ... <script type="text/javascript" src="/map/lib/openlayers.js"></script> ... </body> </html> so can't add buttons in #map. how add custom div on map via js?
oh, should used document.createelement("div") instead innerhtml
Comments
Post a Comment