[OpenLayers-Users] Keep Feature.Vector visible near the maps
border
J.Schumann
j_schumann at gmx.de
Wed Feb 17 16:52:19 EST 2010
Hello,
thanks for that, i'll give it a try or maybe I adjust it to add +X
pixels to each side of this.extent for the intersect-check.
J.Schumann
Am 17.02.2010 22:27, schrieb Arnd Wippermann [via OSGeo.org]:
> Hi,
>
> I use externalGraphic as Image layer and had the same problem. The image
> vanished, when the point lie outside the view.
>
> I have patched for this purpose the drawFeature function of renderer.js (as
> Andreas suggest). I add an attribute render="drawAlways" to my feature(s)
> and in the patched function I test for the attribute.
>
> It works perfect.
>
> drawFeature: function(feature, style) {
> if(style == null) {
> style = feature.style;
> }
> if (feature.geometry) {
> var bounds = feature.geometry.getBounds();
> if(bounds) {
> if(!bounds.intersectsBounds(this.extent) &&
> (feature.attributes.render == "undefined" || feature.attributes.render !=
> "drawAlways"))
> {style={display:"none"};
> }
> /*
> if (!bounds.intersectsBounds(this.extent)) {
> style = {display: "none"};
> }
> */
> var rendered = this.drawGeometry(feature.geometry, style,
> feature.id);
> if(style.display != "none" && style.label && rendered !==
> false) {
> this.drawText(feature.id, style,
> feature.geometry.getCentroid());
> } else {
> this.removeText(feature.id);
> }
> return rendered;
> }
> }
> },
>
> http://gis.ibbeck.de/ginfo/apps/OLExamples/OL27/examples/ExternalGraphicOver
> lay/ExternalGraphicOverlay.asp
> The examples shows the use of externalGraphic as Image layer with the
> possibility to rotate an image.
>
> Arnd
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: [hidden email]
> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=4588629&i=0>
> [mailto:[hidden email]
> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=4588629&i=1>] Im
> Auftrag von J.Schumann
> Gesendet: Mittwoch, 17. Februar 2010 17:24
> An: [hidden email]
> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=4588629&i=2>
> Betreff: [OpenLayers-Users] Keep Feature.Vector visible near the maps
> border
>
>
> Hi!
>
> I'm using OpenLayers.Feature.Vector with OpenLayers.Geometry.Point and a
> StyleMap using an externalGraphic. This works good except the fact that the
> features dissappear to early near the map border, when the Point leaves the
> viewport. But I need the externalGraphic to stay visible for some more
> pixels even when the graphics center / the Geometry.Point leaves the
> map. Is
> there any threshold I can set for this purpose?
>
> Best regards,
> J.Schumann
> --
> View this message in context:
> http://n2.nabble.com/Keep-Feature-Vector-visible-near-the-maps-border-tp4586
> 959p4586959.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> [hidden email]
> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=4588629&i=3>
> http://openlayers.org/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> [hidden email]
> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=4588629&i=4>
> http://openlayers.org/mailman/listinfo/users
>
>
> View message @
> http://n2.nabble.com/Keep-Feature-Vector-visible-near-the-maps-border-tp4586959p4588629.html
>
> To unsubscribe from Keep Feature.Vector visible near the maps border,
> click here
> < (link removed) ==>.
>
>
--
View this message in context: http://n2.nabble.com/Keep-Feature-Vector-visible-near-the-maps-border-tp4586959p4588778.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100217/6d6e32a4/attachment.html
More information about the Users
mailing list