[OpenLayers-Users] How to add a an overlay on top of a map?

Jatin Ambasana jatin.a at iworktech.com
Tue Feb 3 02:45:31 EST 2009


hey newbie....

I was busy for last some days so wasn't able to see ur message......

I didn't get time to see the "line not staying on layer" problem and I think
we will have to consult someone else for getting help on this.

Well for your curosity..... I have noticed that if you want to cancel the
drawing on map (if you have mis-drawn some point) then you can do it by
selecting another control's radio button. You cannot even cancel drawing by
pressing escape key.....

Frankly speaking I think OpenLayers is (somewhat) lacking that capability of
providing feature drawing nicely, but well...... whatever it is providing
right now, is not less though.


On Tue, Jan 27, 2009 at 10:03 PM, newbie <shai_mus at hotmail.com> wrote:

>
> Dear Jatin,
>             Thank you for your help. I really appreciate it. I try to edit
> your code and added this one below. But unfortunately the map didnt appear.
> I have managed to get the drawing and also once I click i can see the
> points
> coordinate but have u managed to why the line not stay? So what I am also
> curious incase I make a mistake in my drawing can I edit or erase it ? My
> next step I want to save this coordinate into my database how do you
> suggest
> ? Thanks.
> var wmsLayer = new OpenLayers.Layer.WMS(
>                    "topp:penang_polyline - Tiled",
> "http://localhost:8080/geoserver/wms",
>                    {
>                        layers: 'topp:penang_polyline',
>                        styles: '',
>                        height: '550',
>                        width: '502',
>                        srs: 'EPSG:4326',
>
>
>                        tilesOrigin : "100.3178548,5.3952127999237645"
>                    },
>                    {buffer: 0}
>                );
>
> Jatin Ambasana wrote:
> >
> > Sorry I forgot to attach the file that I mentioned in my previous
> post....
> > I have named it as draw-feature2.html
> >
> >
> >
> >
> > Jatin Ambasana wrote:
> >>
> >> hey newbie...
> >>
> >> For drawing vector features.....
> >> you can refer to
> >> http://openlayers.org/dev/examples/draw-feature.html
> >> http://openlayers.org/dev/examples/drag-feature.html
> >>
> >> To achieve the functionality you need you can follow any of 2 methods
> >> mentioned below:
> >>
> >> 1)Change the following code in draw-feature.html:
> >>
> >> // This lets you call a function when a feature is inserted on vector
> >> layer
> >> var lineLayer = new OpenLayers.Layer.Vector("Line
> >> Layer",{onFeatureInsert: featureIsAdded});
> >>
> >> //Add this funtion in your code
> >> function featureIsAdded(feature){
> >>      alert("Feature with id: "+feature.id+", has following Geometry:
> >> "+feature.geometry);
> >> }
> >>
> >> I feel that would be sufficient for you......
> >>
> >> 2)There is also another nice example but some what different that you
> can
> >> see from:
> >>  http://openlayers.org/pipermail/users/2007-June/001998.html
> >> http://openlayers.org/pipermail/users/2007-June/001998.html
> >>
> >> I have modified that code and I am attaching that with this post.... But
> >> it has few problems.... It does show you the co-oridnates of all points
> >> of the line drawn but it does not add the line to the Line Layer...
> >>
> >> I don't understand why it works in the previous standard OpenLayers
> >> example and not in the second example that I downloaded from above
> >> link......
> >>
> >> If someone has solution for that then that would nice of him/her.....
> >>
> >>
> >> newbie wrote:
> >>>
> >>> Dear All,
> >>>            I am using geoserver and managed to put a sample shapefile
> >>> and able to view my simple map well. The problem now is that on top
> that
> >>> map I want to add a layer where I can like draw polygon and capture the
> >>> coordinates accordingly. How can I do this ? Thanks.
> >>>
> >>
> >>
> >  http://n2.nabble.com/file/n2222990/draw-feature2.htmldraw-feature2.html
> >
>
> --
> View this message in context:
> http://n2.nabble.com/How-to-add-a-an-overlay-on-top-of-a-map--tp2196295p2226702.html
>  Sent from the OpenLayers Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



-- 
Regards,
Jatin Ambasana
iWork Technologies Pvt. Ltd.
Mobile:+91-9765394718
Mail:  jatin.a at iworktech.com
Visit us: www.iworktech.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090203/e2160f6b/attachment.html


More information about the Users mailing list