ThinkGeo.com    |     Documentation    |     Premium Support

How to make small line still appears when dezooming a lot

Hi,

I have a lot of small lines. When I zoom a lot, point and line have the same size. When I start unzooming, they keep having the same size, then after a certain zoom level, line become thiner and at a certain point we can barely see them and the smallest one are even not visible anymore. On the other side, point have the same visual aspect at every zoom.

What can I do to know there is a line when looking from a far zoom level ? I should at least see something like a dot, when looking at very far zoom level, no ?

Hi Judicael,

Does that the base map or your custom map?

I don’t think the style will change if you hadn’t set the different styles for different zoomlevels, so could you please double check your styles for line?

Regards,

Ethan

Sorry Ethan I forgot to mention my layer/style.

So i’m using an InMemoryFeatureLayer, and apply the following style :

          LineStyle style = new LineStyle();
          style.OuterPen = new GeoPen(color, linesize);
          layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(style);
          layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;


        TextStyle textStyle = new TextStyle("Etiquette", new GeoFont("Arial", etiquetteSize), new GeoSolidBrush(color));
        textStyle.OverlappingRule = LabelOverlappingRule.AllowOverlapping;
        textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels;
        textStyle.PointPlacement = PointPlacement.LowerCenter;
        textStyle.YOffsetInPixel = -20;
        layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(textStyle);
        layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

Hi Judicael,

I build a simple sample here, but I hadn’t watched the line get thinner when zoom in, in some levels, it looks thinner but if you wait some seconds, it render correct, I think that’s maybe because the render is a little slow for Android.

Please view the sample here:

9541.zip (14.5 KB)

Regards,

Ethan

Hi Ethan, thanks for the sample.

I just tried it and after hitting 15 times the “minus” sign to unzoom, I almost didn’t see the point or the line. From my point of view the dot should remain the same no matter how many time I unzoom. The line should still be visible (even if it is just a square). Our client have line/dot over a big surface and they need to know where to zoom.

Hi Judicael,

I think I misunderstand your requirement before, it looks you want to make the line or point visible after zoom out but not zoom in.

For point, I think it should keep its size for any level, our developer will look into it, and I will update the status about it here.

But for line, because it’s based on world coordinates but not screen coordinates, so its size will keep reduce, and after reduce to smaller than a special value, generally smaller than a pixel, we won’t draw it again, I think for line it’s correct.

If you want to modify it, you can write a custom style, which draw the style based on screen coordinates, so it won’t get smaller follow zoomlevel change.

Regards,

Ethan

Hi Ethan,

Yes we need to be able to view point/line/area when we zoom out.
So I’m waiting for an answer from your developer for points.
For lines, I don’t understand why you don’t draw them when the line is less than a pixel. We should I least see something like a point, no ? Because if you zoom out to see the entire world, and have a small line, you won’t know where to zoom to see it, while you will know where to zoom if you had a point instead.

If the only solution is to write my own custom style, could you provide a sample ?

Best regards,

Hi Judicael,

We are working for the point, development team discuss about it.

In fact if the shape is smaller than basic pixel it still be rendered as a point, when user zoom out to high level(map contains too many shapes), the map will be filled by points, and that’s not friendly for map viewer, and viewer also cannot know what’s the point exactly is, so it’s meaningless render.

About render scaling shapes, you can refer our samples here, it shows how to modify the drawing logic for style in DrawCore for different scale, it should be helpful.

https://wiki.thinkgeo.com/wiki/source_code_serviceseditionsample_scalingtextstyle_cs_090918.zip
https://wiki.thinkgeo.com/wiki/source_code_serviceseditionsample_adjustedscalingimagestyle_cs_091222.zip

Regards,

Ethan

Hi Judicael,

Our developer research it, then found the mainly reason of the point disappear is because the default snappint mode is TileSnappingMode.Snapping, which means when you zoom out to higher than level 1, the map always handle the tile image of level 1, when it’s high enough, the shapes disappar, because it’s too small.

So you can make it works just add this line:
layerOverlay.TileSnappingMode = TileSnappingMode.NoSnapping;

It makes the shape keep been drawn when you zoom out. The point will keep to draw follow its style, and the other shapes will be drawn only one pixel (generally you cannot watch it by eyes).

And now it have another problem now, when you keep zoom out, in certain level the point get changed the style, the solution for that is change the tile type in very high levels: layerOverlay.TileType = TileType.SingleTile

Wish that’s helpful, and our developer will did more research to make sure whether it have other problem about it.

Regards,

Ethan