SlideShare a Scribd company logo
1 of 32
Download to read offline
Mapion Android Maps
        API
 #MA6 Mashup Caravan Android/VOCALOID
                  Talks



              2010/10/27
n
    n             / @honjo2
n
    n

n
    n

n
    n       API
    n
    n   Mapion Android Maps API
Mapion Android Maps API
n         Google Maps API
n

n
n   Android 1.6
1.       API
     n     http://labs.mapion.co.jp/api/androidmaps/register.html


2.                       jar
     n     http://labs.mapion.co.jp/api/dl/maps-0.8.jar



3.       AndroidManifest.xml
     n     <uses-permission android:name="android.permission.INTERNET"
           />
(1/2)
public class MainActivity extends MapActivity {
  @Override
  public void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    MapView mapView = new MapView(this,
       APIKEY");
    mapView.setClickable(true); // false
    setContentView(mapView);
  }
}
(2/2)
n
    n   http://gist.github.com/635850
n                               /
(1/2)
//
mapView.getController().setCenter(
  new GeoPoint(
    (int) (35.7 * 1E6),
    (int) (139.7 * 1E6)
));

//
mapView.getController().setZoom(5);
(2/2)

n
    n   http://gist.github.com/635882
n                               /
(1/2)
//
mapView.getController().setCenter(
   new GeoPoint(
     (int) (35.7 * 1E6),
     (int) (139.7 * 1E6)
));

//
mapView.getController().animateTo(
   new GeoPoint(
     (int) (35.7 * 1E6),
     (int) (139.7 * 1E6)
));
(2/2)
n
    n   http://gist.github.com/635917
n                               /
(1/2)
Overlay circle = new Overlay() {
  @Override
  public void draw(Canvas canvas, MapView mapView, boolean shadow) {
                                          mapView,
    if (!shadow) {
      GeoPoint p = new GeoPoint((int) (35.641625 * 1E6),
                       GeoPoint((int)
        (int) (139.749803 * 1E6));
         int)

       Point pos = mapView.getProjection().toPixels(p, null);
                   mapView.getProjection().toPixels(p, null);

       Paint paint = new Paint();
       paint.setColor(Color.argb(150, 255, 0, 255));
       paint.setColor(Color.argb(150,
       paint.setAntiAlias(true);
       paint.setAntiAlias(true);

       canvas.drawCircle(pos.x, pos.y, 30.0f, paint);
       canvas.drawCircle(pos.x, pos.y,
   }
  }
};
mapView.getOverlays().add(circle);
mapView.getOverlays().add(circle);
(2/2)
n
    n   http://gist.github.com/635930
n                               /
(1/2)
Overlay line = new Overlay() {
  @Override
  public void draw(Canvas canvas, MapView mapView, boolean shadow) {
                                          mapView,
    if (!shadow) {
      GeoPoint one = new GeoPoint((int) (35.641625 * 1E6), (int) (139.749803 *
                         GeoPoint((int)                    (int)                 1E6));
      GeoPoint two = new GeoPoint((int) (35.642625 * 1E6), (int) (139.747803 *
                         GeoPoint((int)                    (int)                 1E6));
      GeoPoint three = new GeoPoint((int) (35.642625 * 1E6), (int) (139.750803
                           GeoPoint((int)                    (int)               * 1E6));

       Point   onePoint =   mapView.getProjection().toPixels(one, null);
                            mapView.getProjection().toPixels(one, null);
       Point   twoPoint =   mapView.getProjection().toPixels(two, null);
                            mapView.getProjection().toPixels(two, null);
       Point   threePoint   = mapView.getProjection().toPixels(three, null);
                              mapView.getProjection().toPixels(three, null);

       Paint paint = new Paint();
       paint.setAntiAlias(true);
       paint.setAntiAlias(true);

       paint.setStrokeWidth(4);
       paint.setStyle(Paint.Style.STROKE);
       paint.setStyle(Paint.Style.STROKE);
       paint.setColor(Color.argb(150, 255, 0, 255));
       paint.setColor(Color.argb(150,
       canvas.drawLines(new float[]{onePoint.x, onePoint.y, twoPoint.x, twoPoint.y,
       canvas.drawLines(new float[]{onePoint.x, onePoint.y, twoPoint.x, twoPoint.y,
         twoPoint.x, twoPoint.y, threePoint.x, threePoint.y}, paint);
         twoPoint.x, twoPoint.y, threePoint.x, threePoint.y},
   }
   }
};
mapView.getOverlays().add(line);
mapView.getOverlays().add(line);
(2/2)
n
    n   http://gist.github.com/635942
n                               /
(1/2)
Overlay polygon = new Overlay() {
  @Override
  public void draw(Canvas canvas, MapView mapView, boolean shadow) {
                                          mapView,
    if (!shadow) {
      GeoPoint one = new GeoPoint(35641625, 139749803);
      GeoPoint two = new GeoPoint(35642625, 139747803);
      GeoPoint three = new GeoPoint(35642625, 139751803);

      Point onePoint = mapView.getProjection().toPixels(one, null);
                       mapView.getProjection().toPixels(one, null);
      Point twoPoint = mapView.getProjection().toPixels(two, null);
                       mapView.getProjection().toPixels(two, null);
      Point threePoint = mapView.getProjection().toPixels(three, null);
                         mapView.getProjection().toPixels(three, null);

      Paint paint = new Paint();
      paint.setAntiAlias(true);
      paint.setAntiAlias(true);
      paint.setColor(Color.argb(150, 255, 0, 255));
      paint.setColor(Color.argb(150,
      paint.setStyle(Paint.Style.FILL_AND_STROKE);
      paint.setStyle(Paint.Style.FILL_AND_STROKE);
      Path path = new Path();

      path.moveTo(onePoint.x, onePoint.y);
      path.moveTo(onePoint.x, onePoint.y);
      path.lineTo(twoPoint.x, twoPoint.y);
      path.lineTo(twoPoint.x, twoPoint.y);
      path.lineTo(threePoint.x, threePoint.y);
      path.lineTo(threePoint.x, threePoint.y);
      path.lineTo(onePoint.x, onePoint.y);
      path.lineTo(onePoint.x, onePoint.y);
      canvas.drawPath(path, paint);
      canvas.drawPath(path,
    }
  }
};
mapView.getOverlays().add(polygon);
mapView.getOverlays().add(polygon);
(2/2)
n
    n   http://gist.github.com/635949
n                               /
(1/2)
n   ItemizedOverlay
(2/2)
n
    n   http://gist.github.com/635958
n                               /
(1/2)
mapView.setRotation(true);
mapView.setDegrees(45.0f); //
(2/2)
n
    n   http://gist.github.com/635978
n
R               (1/2)
@Override
public boolean onSingleTapUp(MotionEvent e) {
  GeoPoint temp = mapView.getProjection()
    .fromPixels(
      (int) e.getX(),
      (int) e.getY()
    );

    mapView.getController().animateTo(temp);

    return false;
}
R             (2/2)

n
    n   http://gist.github.com/633865
n                               /
(1/2)
n
    n   mapView.changeMap(MapView.STANDARD);


n
    n   mapView.changeMap(MapView.LIGHT);
(2/2)
n
    n   http://gist.github.com/648611
n
Tips
n
    GeoPoint tky = Map.wgsToTky(
      new GeoPoint(35500000, 139500000)
    );
    GeoPoint wgs = Map.tkyToWgs(tky);


n
    n         10 1 10
    n   Max             MapView#getMaxZoomLevel
n   Google Maps
n
n       Google Maps
n        Android
n
    n

    n

n
n
    n
    n         VOCALOID
n
    n

n   Geo
    n   Geo
n

n
n   Android Maps API
    n



n
    n
    n   Android
         n
         n             256x256   128x128

More Related Content

What's hot

ggplot2できれいなグラフ
ggplot2できれいなグラフggplot2できれいなグラフ
ggplot2できれいなグラフ
Daisuke Ichikawa
 

What's hot (20)

My favorite slides
My favorite slidesMy favorite slides
My favorite slides
 
662305 LAB12
662305 LAB12662305 LAB12
662305 LAB12
 
Geo Spatial Plot using R
Geo Spatial Plot using R Geo Spatial Plot using R
Geo Spatial Plot using R
 
Geolocation Databases in Ruby on Rails
Geolocation Databases in Ruby on RailsGeolocation Databases in Ruby on Rails
Geolocation Databases in Ruby on Rails
 
Data visualization with multiple groups using ggplot2
Data visualization with multiple groups using ggplot2Data visualization with multiple groups using ggplot2
Data visualization with multiple groups using ggplot2
 
Basics of Computer graphics lab
Basics of Computer graphics labBasics of Computer graphics lab
Basics of Computer graphics lab
 
Games 3 dl4-example
Games 3 dl4-exampleGames 3 dl4-example
Games 3 dl4-example
 
Maps
MapsMaps
Maps
 
Funções 3
Funções 3Funções 3
Funções 3
 
ggplot2できれいなグラフ
ggplot2できれいなグラフggplot2できれいなグラフ
ggplot2できれいなグラフ
 
Butterfly Counting in Bipartite Networks
Butterfly Counting in Bipartite NetworksButterfly Counting in Bipartite Networks
Butterfly Counting in Bipartite Networks
 
Introduction to graphics programming in c
Introduction to graphics programming in cIntroduction to graphics programming in c
Introduction to graphics programming in c
 
computer graphics slides by Talha shah
computer graphics slides by Talha shahcomputer graphics slides by Talha shah
computer graphics slides by Talha shah
 
The Ring programming language version 1.5.3 book - Part 65 of 184
The Ring programming language version 1.5.3 book - Part 65 of 184The Ring programming language version 1.5.3 book - Part 65 of 184
The Ring programming language version 1.5.3 book - Part 65 of 184
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Computer graphics practical(jainam)
Computer graphics practical(jainam)Computer graphics practical(jainam)
Computer graphics practical(jainam)
 
OpenGL Starter L02
OpenGL Starter L02OpenGL Starter L02
OpenGL Starter L02
 
Types of function
Types of function Types of function
Types of function
 
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
 
analog clock C#
analog clock C#analog clock C#
analog clock C#
 

Similar to Mashup caravan android-talks

import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdfimport java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
anyacarpets
 
-- USING UNITY TRYING TO CREATE A CLICK TO PATH- THAT YOU CLICK ON AND.pdf
-- USING UNITY TRYING TO CREATE A CLICK TO PATH- THAT YOU CLICK ON AND.pdf-- USING UNITY TRYING TO CREATE A CLICK TO PATH- THAT YOU CLICK ON AND.pdf
-- USING UNITY TRYING TO CREATE A CLICK TO PATH- THAT YOU CLICK ON AND.pdf
ganisyedtrd
 
Create a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdfCreate a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdf
arihantmobileselepun
 
package chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdfpackage chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdf
KARTIKINDIA
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring Canvas
Kevin Hoyt
 
Bindings: the zen of montage
Bindings: the zen of montageBindings: the zen of montage
Bindings: the zen of montage
Kris Kowal
 
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdfImport java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
apexcomputer54
 

Similar to Mashup caravan android-talks (20)

Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
 
Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2ME
 
Creating an Uber Clone - Part VIII.pdf
Creating an Uber Clone - Part VIII.pdfCreating an Uber Clone - Part VIII.pdf
Creating an Uber Clone - Part VIII.pdf
 
Maps - Part 3.pdf
Maps - Part 3.pdfMaps - Part 3.pdf
Maps - Part 3.pdf
 
libGDX: Tiled Maps
libGDX: Tiled MapslibGDX: Tiled Maps
libGDX: Tiled Maps
 
Applications
ApplicationsApplications
Applications
 
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdfimport java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
 
Creating an Uber Clone - Part VII.pdf
Creating an Uber Clone - Part VII.pdfCreating an Uber Clone - Part VII.pdf
Creating an Uber Clone - Part VII.pdf
 
-- USING UNITY TRYING TO CREATE A CLICK TO PATH- THAT YOU CLICK ON AND.pdf
-- USING UNITY TRYING TO CREATE A CLICK TO PATH- THAT YOU CLICK ON AND.pdf-- USING UNITY TRYING TO CREATE A CLICK TO PATH- THAT YOU CLICK ON AND.pdf
-- USING UNITY TRYING TO CREATE A CLICK TO PATH- THAT YOU CLICK ON AND.pdf
 
662305 11
662305 11662305 11
662305 11
 
Creating an Uber Clone - Part VIII - Transcript.pdf
Creating an Uber Clone - Part VIII - Transcript.pdfCreating an Uber Clone - Part VIII - Transcript.pdf
Creating an Uber Clone - Part VIII - Transcript.pdf
 
Maps - Part 3 - Transcript.pdf
Maps - Part 3 - Transcript.pdfMaps - Part 3 - Transcript.pdf
Maps - Part 3 - Transcript.pdf
 
Create a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdfCreate a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdf
 
openFrameworks 007 - 3D
openFrameworks 007 - 3DopenFrameworks 007 - 3D
openFrameworks 007 - 3D
 
package chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdfpackage chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdf
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring Canvas
 
Adding where to your ruby apps
Adding where to your ruby appsAdding where to your ruby apps
Adding where to your ruby apps
 
Map kit light
Map kit lightMap kit light
Map kit light
 
Bindings: the zen of montage
Bindings: the zen of montageBindings: the zen of montage
Bindings: the zen of montage
 
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdfImport java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Mashup caravan android-talks

  • 1. Mapion Android Maps API #MA6 Mashup Caravan Android/VOCALOID Talks 2010/10/27
  • 2. n n / @honjo2 n n n n n n API n n Mapion Android Maps API
  • 3. Mapion Android Maps API n Google Maps API n n
  • 4. n Android 1.6
  • 5. 1. API n http://labs.mapion.co.jp/api/androidmaps/register.html 2. jar n http://labs.mapion.co.jp/api/dl/maps-0.8.jar 3. AndroidManifest.xml n <uses-permission android:name="android.permission.INTERNET" />
  • 6.
  • 7. (1/2) public class MainActivity extends MapActivity { @Override public void onCreate(Bundle bundle) { super.onCreate(bundle); MapView mapView = new MapView(this, APIKEY"); mapView.setClickable(true); // false setContentView(mapView); } }
  • 8. (2/2) n n http://gist.github.com/635850 n /
  • 9. (1/2) // mapView.getController().setCenter( new GeoPoint( (int) (35.7 * 1E6), (int) (139.7 * 1E6) )); // mapView.getController().setZoom(5);
  • 10. (2/2) n n http://gist.github.com/635882 n /
  • 11. (1/2) // mapView.getController().setCenter( new GeoPoint( (int) (35.7 * 1E6), (int) (139.7 * 1E6) )); // mapView.getController().animateTo( new GeoPoint( (int) (35.7 * 1E6), (int) (139.7 * 1E6) ));
  • 12. (2/2) n n http://gist.github.com/635917 n /
  • 13. (1/2) Overlay circle = new Overlay() { @Override public void draw(Canvas canvas, MapView mapView, boolean shadow) { mapView, if (!shadow) { GeoPoint p = new GeoPoint((int) (35.641625 * 1E6), GeoPoint((int) (int) (139.749803 * 1E6)); int) Point pos = mapView.getProjection().toPixels(p, null); mapView.getProjection().toPixels(p, null); Paint paint = new Paint(); paint.setColor(Color.argb(150, 255, 0, 255)); paint.setColor(Color.argb(150, paint.setAntiAlias(true); paint.setAntiAlias(true); canvas.drawCircle(pos.x, pos.y, 30.0f, paint); canvas.drawCircle(pos.x, pos.y, } } }; mapView.getOverlays().add(circle); mapView.getOverlays().add(circle);
  • 14. (2/2) n n http://gist.github.com/635930 n /
  • 15. (1/2) Overlay line = new Overlay() { @Override public void draw(Canvas canvas, MapView mapView, boolean shadow) { mapView, if (!shadow) { GeoPoint one = new GeoPoint((int) (35.641625 * 1E6), (int) (139.749803 * GeoPoint((int) (int) 1E6)); GeoPoint two = new GeoPoint((int) (35.642625 * 1E6), (int) (139.747803 * GeoPoint((int) (int) 1E6)); GeoPoint three = new GeoPoint((int) (35.642625 * 1E6), (int) (139.750803 GeoPoint((int) (int) * 1E6)); Point onePoint = mapView.getProjection().toPixels(one, null); mapView.getProjection().toPixels(one, null); Point twoPoint = mapView.getProjection().toPixels(two, null); mapView.getProjection().toPixels(two, null); Point threePoint = mapView.getProjection().toPixels(three, null); mapView.getProjection().toPixels(three, null); Paint paint = new Paint(); paint.setAntiAlias(true); paint.setAntiAlias(true); paint.setStrokeWidth(4); paint.setStyle(Paint.Style.STROKE); paint.setStyle(Paint.Style.STROKE); paint.setColor(Color.argb(150, 255, 0, 255)); paint.setColor(Color.argb(150, canvas.drawLines(new float[]{onePoint.x, onePoint.y, twoPoint.x, twoPoint.y, canvas.drawLines(new float[]{onePoint.x, onePoint.y, twoPoint.x, twoPoint.y, twoPoint.x, twoPoint.y, threePoint.x, threePoint.y}, paint); twoPoint.x, twoPoint.y, threePoint.x, threePoint.y}, } } }; mapView.getOverlays().add(line); mapView.getOverlays().add(line);
  • 16. (2/2) n n http://gist.github.com/635942 n /
  • 17. (1/2) Overlay polygon = new Overlay() { @Override public void draw(Canvas canvas, MapView mapView, boolean shadow) { mapView, if (!shadow) { GeoPoint one = new GeoPoint(35641625, 139749803); GeoPoint two = new GeoPoint(35642625, 139747803); GeoPoint three = new GeoPoint(35642625, 139751803); Point onePoint = mapView.getProjection().toPixels(one, null); mapView.getProjection().toPixels(one, null); Point twoPoint = mapView.getProjection().toPixels(two, null); mapView.getProjection().toPixels(two, null); Point threePoint = mapView.getProjection().toPixels(three, null); mapView.getProjection().toPixels(three, null); Paint paint = new Paint(); paint.setAntiAlias(true); paint.setAntiAlias(true); paint.setColor(Color.argb(150, 255, 0, 255)); paint.setColor(Color.argb(150, paint.setStyle(Paint.Style.FILL_AND_STROKE); paint.setStyle(Paint.Style.FILL_AND_STROKE); Path path = new Path(); path.moveTo(onePoint.x, onePoint.y); path.moveTo(onePoint.x, onePoint.y); path.lineTo(twoPoint.x, twoPoint.y); path.lineTo(twoPoint.x, twoPoint.y); path.lineTo(threePoint.x, threePoint.y); path.lineTo(threePoint.x, threePoint.y); path.lineTo(onePoint.x, onePoint.y); path.lineTo(onePoint.x, onePoint.y); canvas.drawPath(path, paint); canvas.drawPath(path, } } }; mapView.getOverlays().add(polygon); mapView.getOverlays().add(polygon);
  • 18. (2/2) n n http://gist.github.com/635949 n /
  • 19. (1/2) n ItemizedOverlay
  • 20. (2/2) n n http://gist.github.com/635958 n /
  • 22. (2/2) n n http://gist.github.com/635978 n
  • 23. R (1/2) @Override public boolean onSingleTapUp(MotionEvent e) { GeoPoint temp = mapView.getProjection() .fromPixels( (int) e.getX(), (int) e.getY() ); mapView.getController().animateTo(temp); return false; }
  • 24. R (2/2) n n http://gist.github.com/633865 n /
  • 25. (1/2) n n mapView.changeMap(MapView.STANDARD); n n mapView.changeMap(MapView.LIGHT);
  • 26. (2/2) n n http://gist.github.com/648611 n
  • 27. Tips n GeoPoint tky = Map.wgsToTky( new GeoPoint(35500000, 139500000) ); GeoPoint wgs = Map.tkyToWgs(tky); n n 10 1 10 n Max MapView#getMaxZoomLevel
  • 28. n Google Maps
  • 29. n n Google Maps n Android n n n n
  • 30. n n n VOCALOID n n n Geo n Geo
  • 31. n n
  • 32. n Android Maps API n n n n Android n n 256x256 128x128