Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone Map Slicing Tool #4

Open
dbarysk opened this issue Mar 4, 2015 · 17 comments
Open

Standalone Map Slicing Tool #4

dbarysk opened this issue Mar 4, 2015 · 17 comments

Comments

@dbarysk
Copy link
Contributor

dbarysk commented Mar 4, 2015

Currently slicing tool implemented in form of Eclipse Kepler plugin. For Android Studio users it would be great if it was a standalone java GUI app (basically with the same UI as the plugin).

@ghost
Copy link

ghost commented Mar 9, 2015

Kepler standard or EE edition?

@dbarysk
Copy link
Contributor Author

dbarysk commented Mar 9, 2015

I believe it doesn't matter. You need to build the plugin from sources. Checkout mappwidget, import slicing tool into Eclipse and run it as an Eclipse application.

@ghost
Copy link

ghost commented Mar 10, 2015

I solved it. Begin to try.

@ghost
Copy link

ghost commented Mar 10, 2015

I now have a question. Class MapObject's constructor (that has parameter x, y). When I want to use geographic coordinates in map, how do these two parameters work?
At the end I use MapObject's moveTo() method just like the snippet:

MapObject poi = new MapObject(objId, poiIcon, new Point(0, 0),
PivotFactory.createPivotPoint(poiIcon, PivotFactory.PivotPosition.PIVOT_CENTER), true, false));
sceneryLayer.addMapObject(poi);
Location location = new Location("");
location.setLongitude(point.getLongitude());
location.setLatitude(point.getLatitude());
poi.moveTo(location);

I Solved it now.

@dbarysk
Copy link
Contributor Author

dbarysk commented Mar 10, 2015

Basically you can create MapObject with some initial zero coordinates (in pixels) and then use moveTo method to move it around using geographical coordinates. But please note, that map has to be calibrated for this to work.

@dbarysk
Copy link
Contributor Author

dbarysk commented Mar 10, 2015

I believe yes, you can use only one MapObject in layer.

On Tue, Mar 10, 2015 at 8:58 AM, Nicholas Ni notifications@github.com
wrote:

I read the "how-to-use" .
I have the a doubt: Does one layer instance can just contain only one
MapObject?


Reply to this email directly or view it on GitHub
#4 (comment).

  • Dmytro Baryskyy* Co-founder | Smart Atoms

phone:+44 (0) 20 7193 4928, ext. 719

web: http://www.s http://www.lemberg.co.uk/martatoms.com
facebook: https://www.facebook.com/smartatoms
twitter: https://twitter.com/smartatoms

@dbarysk
Copy link
Contributor Author

dbarysk commented Mar 10, 2015

Can I hide the logo on the right bottom?
Yes, you can. But you need to mention the license somewhere in "About" in
your app.

On Tue, Mar 10, 2015 at 12:11 PM, Dmytro Baryskyy <
dmytro.baryskyy@smartatoms.com> wrote:

I believe yes, you can use only one MapObject in layer.

On Tue, Mar 10, 2015 at 8:58 AM, Nicholas Ni notifications@github.com
wrote:

I read the "how-to-use" .
I have the a doubt: Does one layer instance can just contain only one
MapObject?


Reply to this email directly or view it on GitHub
#4 (comment).

  • Dmytro Baryskyy* Co-founder | Smart Atoms

phone:+44 (0) 20 7193 4928, ext. 719

web: http://www.s http://www.lemberg.co.uk/martatoms.com
facebook: https://www.facebook.com/smartatoms
twitter: https://twitter.com/smartatoms

  • Dmytro Baryskyy* Co-founder | Smart Atoms

phone:+44 (0) 20 7193 4928, ext. 719

web: http://www.s http://www.lemberg.co.uk/martatoms.com
facebook: https://www.facebook.com/smartatoms
twitter: https://twitter.com/smartatoms

@ghost
Copy link

ghost commented Mar 10, 2015

OK

@ghost
Copy link

ghost commented Mar 10, 2015

How can I draw lines between points.
I tried but failed.
layer's draw method did not work.

@ghost
Copy link

ghost commented Mar 10, 2015

Is there snippet to study?

@dbarysk
Copy link
Contributor Author

dbarysk commented Mar 10, 2015

The plan is to create different kind of figures to draw, like lines,
rectangles, polygons, etc.
Here is an example of a line object I created some time ago (find attached).

Hope it helps

On Tue, Mar 10, 2015 at 1:10 PM, Nicholas Ni notifications@github.com
wrote:

Is there snippet to study?


Reply to this email directly or view it on GitHub
#4 (comment).

  • Dmytro Baryskyy* Co-founder | Smart Atoms

phone:+44 (0) 20 7193 4928, ext. 719

web: http://www.s http://www.lemberg.co.uk/martatoms.com
facebook: https://www.facebook.com/smartatoms
twitter: https://twitter.com/smartatoms

@ghost
Copy link

ghost commented Mar 10, 2015

Where's the attachment? I do not find it.

@dbarysk
Copy link
Contributor Author

dbarysk commented Mar 10, 2015

Oops, sent it to your e-mail. Looks like if reply via e-mail attachments get lost.
In case if you do not receive the e-mail, here is the example of map object that can draw line between two points on a map:

package com.ls.demo;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Rect;

import com.ls.widgets.map.model.MapObject;

public class LineObject extends MapObject {

    private Paint paint;
    private Rect bounds;
    private Point start;
    private Point end;

    public LineObject(Object id) {
        super(id, null, 0, 0);

        paint = new Paint();
        paint.setColor(Color.WHITE);
        paint.setAntiAlias(true);
        paint.setStrokeWidth(5);

        start = new Point();
        end = new Point();
    }

    @Override
    public void draw(Canvas canvas) 
    {
        canvas.drawLine(start.x * scale, start.y * scale, end.x * scale, end.y * scale, paint);
    }

    @Override
    public Rect getBounds() 
    {
        return this.bounds;
    }


    public void setStart(int x, int y)
    {
        this.start.set(x, y);
    }


    public void setEnd(int x, int y)
    {
        this.end.set(x, y);
    }

    @Override
    protected void recalculateBounds() 
    {
        super.recalculateBounds();

        if (this.bounds == null) {
            this.bounds = new Rect();
        }

        if (start == null) {
            start = new Point();
        }

        if (end == null) {
            end = new Point();
        }

        this.bounds.left = (int) (Math.min(start.x, end.x) * scale);
        bounds.top = (int) (Math.min(start.y, end.y) * scale);
        bounds.right = (int) (this.bounds.left + (Math.abs(start.x - end.x) * scale));
        bounds.bottom = (int) (this.bounds.top + (Math.abs(start.y - end.y)  * scale));

        setPivotPoint(this.bounds.left - start.x, this.bounds.top - start.y);
    }

}

@ghost
Copy link

ghost commented Mar 11, 2015

Appreciate you support! Now I draw poly-line on the map.

@ghost
Copy link

ghost commented Mar 19, 2015

Can the mappwidget have the rotate function?
Or do you have the plan to develop this function?

1 similar comment
@archanatyu
Copy link

Can the mappwidget have the rotate function?
Or do you have the plan to develop this function?

@anicet-nge
Copy link

hi.please how should the map source looks like.i saved an .png image of a map but can not see it from slicingtool filechooser.thks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants