SlideShare uma empresa Scribd logo
1 de 9
Add markers using openscales 1.2 Tutorial 3 Marine Jourdain
Prerequisites This tutorial begins where ”Create Your First Map Using OpenScales” (tutorial 2) left off. 2
What you obtain with this tutorial 3
Action Script code to obtain the map 4 <fx:Script>         <![CDATA[ importorg.openscales.basetypes.Location; importorg.openscales.core.Map; importorg.openscales.core.feature.CustomMarker; importorg.openscales.core.feature.PointFeature; importorg.openscales.core.layer.FeatureLayer; importorg.openscales.core.style.Style; importorg.openscales.geometry.Point; import org.openscales.proj4as.ProjProjection;             [Bindable] privatevar map:Map = null; privatefunctioninitMap():void {                 map = fxmap.map; varmarkers:FeatureLayer = newFeatureLayer("NameOfYourLayerWithMarkers"); markers.projection = newProjProjection("EPSG:4326"); markers.generateResolutions(19); markers.style = Style.getDefaultPointStyle(); //add the first marker varmarker:PointFeature = PointFeature.createPointFeature(newLocation(4.85680,45.75336)); markers.addFeature(marker); //add a second marker                 marker = PointFeature.createPointFeature(newLocation(4.85780,45.75336)); markers.addFeature(marker); //add marker with different symbol, writing url address markers.addFeature(CustomMarker. createUrlBasedMarker("http://earth.google.com/intl/en_uk/outreach/images/add_placemark.png",  newLocation(4.85580,45.75336))); //add the layer map.addLayer(markers);             }         ]]> </fx:Script>
Add a default style marker (1) A marker is created in the Action Script part of the mxml file. To create a simple marker you need: to create a feature layer to define the system of projection used by the layer to generate the resolutions at which the markers will be visible to define the default style to create a point with the correct coordinates (same projection as the layer) 5
Add a default style marker (2) The Action Script code becomes: <fx:Script>         <![CDATA[ importorg.openscales.core.Map; importorg.openscales.core.feature.PointFeature; importorg.openscales.core.layer.FeatureLayer; importorg.openscales.core.style.Style; importorg.openscales.geometry.Point; import org.openscales.proj4as.ProjProjection;             [Bindable] privatevar map:Map = null; privatefunctioninitMap():void {                 map = fxmap.map; varmarkers:FeatureLayer = newFeatureLayer("NameOfYourLayerWithMarkers"); markers.projection = newProjProjection("EPSG:4326"); markers.generateResolutions(19); markers.style = Style.getDefaultPointStyle(); varmarker:PointFeature=PointFeature.createPointFeature(new Location(4.85980,45.75336)); markers.addFeature(marker); map.addLayer(markers);             }         ]]> </fx:Script> 6
Add another marker Write these two lines before adding the layer (                    ) map.addLayer(markers); marker = PointFeature.createPointFeature(new Location(4.85980,45.75336)); markers.addFeature(marker); 7
Add marker with custom symbol Symbol from URL address: Add this import next to the others: Add the marker using the static CustomMarker.createUrlBasedMarker(url, point) before adding the layer (                      ): importorg.openscales.core.feature.CustomMarker; markers.addFeature(CustomMarker. createUrlBasedMarker("http://earth.google.com/intl/en_uk/outreach/images/add_placemark.png",  		new Location(4.85980,45.75336))); 8 map.addLayer(markers);
Here you are Right now, you’re able to add markers to your OpenScales maps. Find sources: http://www.openscales.org/tutorials/ 9

Mais conteúdo relacionado

Destaque

Presentation DVCS - Git - Mercurial au LyonJug
Presentation DVCS - Git - Mercurial au LyonJugPresentation DVCS - Git - Mercurial au LyonJug
Presentation DVCS - Git - Mercurial au LyonJugSébastien Deleuze
 
Openscales Foss4g 2010 presentation
Openscales Foss4g 2010 presentationOpenscales Foss4g 2010 presentation
Openscales Foss4g 2010 presentationSébastien Deleuze
 
Resthub framework presentation
Resthub framework presentationResthub framework presentation
Resthub framework presentationSébastien Deleuze
 
Torneig infantil cadet
Torneig infantil cadetTorneig infantil cadet
Torneig infantil cadetCEPOBLALLARGA
 
Library Outreach to Veterans Initiative Panel Program CLA 2013
Library Outreach to Veterans Initiative Panel Program CLA 2013Library Outreach to Veterans Initiative Panel Program CLA 2013
Library Outreach to Veterans Initiative Panel Program CLA 2013San Diego Public Library
 
Cartell alevi benjami
Cartell alevi benjamiCartell alevi benjami
Cartell alevi benjamiCEPOBLALLARGA
 
Iemr pgpm 2010 12-prospectus
Iemr pgpm 2010 12-prospectusIemr pgpm 2010 12-prospectus
Iemr pgpm 2010 12-prospectusIEMR
 
Panama presentation. THIS ONE.
Panama presentation. THIS ONE. Panama presentation. THIS ONE.
Panama presentation. THIS ONE. robguevarra007
 
Veterans and public libraries in san diego
Veterans and public libraries in san diegoVeterans and public libraries in san diego
Veterans and public libraries in san diegoSan Diego Public Library
 
Waves in the Abyss: Prologue
Waves in the Abyss: PrologueWaves in the Abyss: Prologue
Waves in the Abyss: PrologueVocman X.
 
Dart : one language to rule them all - MixIT 2013
Dart : one language to rule them all - MixIT 2013Dart : one language to rule them all - MixIT 2013
Dart : one language to rule them all - MixIT 2013Sébastien Deleuze
 

Destaque (16)

Resthub lyonjug
Resthub lyonjugResthub lyonjug
Resthub lyonjug
 
Presentation DVCS - Git - Mercurial au LyonJug
Presentation DVCS - Git - Mercurial au LyonJugPresentation DVCS - Git - Mercurial au LyonJug
Presentation DVCS - Git - Mercurial au LyonJug
 
Openscales Foss4g 2010 presentation
Openscales Foss4g 2010 presentationOpenscales Foss4g 2010 presentation
Openscales Foss4g 2010 presentation
 
Resthub framework presentation
Resthub framework presentationResthub framework presentation
Resthub framework presentation
 
Resthub
ResthubResthub
Resthub
 
Torneig infantil cadet
Torneig infantil cadetTorneig infantil cadet
Torneig infantil cadet
 
THIS PRESENTATION.
THIS PRESENTATION.THIS PRESENTATION.
THIS PRESENTATION.
 
Library Outreach to Veterans Initiative Panel Program CLA 2013
Library Outreach to Veterans Initiative Panel Program CLA 2013Library Outreach to Veterans Initiative Panel Program CLA 2013
Library Outreach to Veterans Initiative Panel Program CLA 2013
 
Cartell alevi benjami
Cartell alevi benjamiCartell alevi benjami
Cartell alevi benjami
 
Iemr pgpm 2010 12-prospectus
Iemr pgpm 2010 12-prospectusIemr pgpm 2010 12-prospectus
Iemr pgpm 2010 12-prospectus
 
Panama presentation. THIS ONE.
Panama presentation. THIS ONE. Panama presentation. THIS ONE.
Panama presentation. THIS ONE.
 
Panama presentation.
Panama presentation.Panama presentation.
Panama presentation.
 
Dart JUG 2013
Dart JUG 2013Dart JUG 2013
Dart JUG 2013
 
Veterans and public libraries in san diego
Veterans and public libraries in san diegoVeterans and public libraries in san diego
Veterans and public libraries in san diego
 
Waves in the Abyss: Prologue
Waves in the Abyss: PrologueWaves in the Abyss: Prologue
Waves in the Abyss: Prologue
 
Dart : one language to rule them all - MixIT 2013
Dart : one language to rule them all - MixIT 2013Dart : one language to rule them all - MixIT 2013
Dart : one language to rule them all - MixIT 2013
 

Semelhante a 03 add markers

Recoil at Codete Webinars #3
Recoil at Codete Webinars #3Recoil at Codete Webinars #3
Recoil at Codete Webinars #3Mateusz Bryła
 
Sapo GIS Hands-On
Sapo GIS Hands-OnSapo GIS Hands-On
Sapo GIS Hands-Oncodebits
 
Gis SAPO Hands On
Gis SAPO Hands OnGis SAPO Hands On
Gis SAPO Hands Oncodebits
 
Gmaps Railscamp2008
Gmaps Railscamp2008Gmaps Railscamp2008
Gmaps Railscamp2008xilinus
 
ESRI Dev Meetup: Building Distributed JavaScript Map Widgets
ESRI Dev Meetup: Building Distributed JavaScript Map WidgetsESRI Dev Meetup: Building Distributed JavaScript Map Widgets
ESRI Dev Meetup: Building Distributed JavaScript Map WidgetsAllan Glen
 
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer ToolsMark Billinghurst
 
Introduction to open gl in android droidcon - slides
Introduction to open gl in android   droidcon - slidesIntroduction to open gl in android   droidcon - slides
Introduction to open gl in android droidcon - slidestamillarasan
 
Opensource gis development - part 3
Opensource gis development - part 3Opensource gis development - part 3
Opensource gis development - part 3Andrea Antonello
 
Intro to computer vision in .net
Intro to computer vision in .netIntro to computer vision in .net
Intro to computer vision in .netStephen Lorello
 
How to use lekhoniya.pdf
How to use lekhoniya.pdfHow to use lekhoniya.pdf
How to use lekhoniya.pdfSubhamMandal40
 
Angularjs Test Driven Development (TDD)
Angularjs Test Driven Development (TDD)Angularjs Test Driven Development (TDD)
Angularjs Test Driven Development (TDD)Anis Bouhachem Djer
 
How data rules the world: Telemetry in Battlefield Heroes
How data rules the world: Telemetry in Battlefield HeroesHow data rules the world: Telemetry in Battlefield Heroes
How data rules the world: Telemetry in Battlefield HeroesElectronic Arts / DICE
 
How to Create Custom Shaders in Flutter?
How to Create Custom Shaders in Flutter?How to Create Custom Shaders in Flutter?
How to Create Custom Shaders in Flutter?Flutter Agency
 
Cocoa Heads Tricity - Design Patterns
Cocoa Heads Tricity - Design PatternsCocoa Heads Tricity - Design Patterns
Cocoa Heads Tricity - Design PatternsMaciej Burda
 

Semelhante a 03 add markers (20)

Recoil at Codete Webinars #3
Recoil at Codete Webinars #3Recoil at Codete Webinars #3
Recoil at Codete Webinars #3
 
Sapo GIS Hands-On
Sapo GIS Hands-OnSapo GIS Hands-On
Sapo GIS Hands-On
 
Gis SAPO Hands On
Gis SAPO Hands OnGis SAPO Hands On
Gis SAPO Hands On
 
Google Maps API 101
Google Maps API 101Google Maps API 101
Google Maps API 101
 
51811680 open layers
51811680 open layers51811680 open layers
51811680 open layers
 
Gmaps Railscamp2008
Gmaps Railscamp2008Gmaps Railscamp2008
Gmaps Railscamp2008
 
ESRI Dev Meetup: Building Distributed JavaScript Map Widgets
ESRI Dev Meetup: Building Distributed JavaScript Map WidgetsESRI Dev Meetup: Building Distributed JavaScript Map Widgets
ESRI Dev Meetup: Building Distributed JavaScript Map Widgets
 
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools
 
Cursor Demo App
Cursor Demo AppCursor Demo App
Cursor Demo App
 
Introduction to open gl in android droidcon - slides
Introduction to open gl in android   droidcon - slidesIntroduction to open gl in android   droidcon - slides
Introduction to open gl in android droidcon - slides
 
Opensource gis development - part 3
Opensource gis development - part 3Opensource gis development - part 3
Opensource gis development - part 3
 
Intro to computer vision in .net
Intro to computer vision in .netIntro to computer vision in .net
Intro to computer vision in .net
 
Scaling Cairngorms
Scaling CairngormsScaling Cairngorms
Scaling Cairngorms
 
How to use lekhoniya.pdf
How to use lekhoniya.pdfHow to use lekhoniya.pdf
How to use lekhoniya.pdf
 
Angularjs Test Driven Development (TDD)
Angularjs Test Driven Development (TDD)Angularjs Test Driven Development (TDD)
Angularjs Test Driven Development (TDD)
 
How data rules the world: Telemetry in Battlefield Heroes
How data rules the world: Telemetry in Battlefield HeroesHow data rules the world: Telemetry in Battlefield Heroes
How data rules the world: Telemetry in Battlefield Heroes
 
How to Create Custom Shaders in Flutter?
How to Create Custom Shaders in Flutter?How to Create Custom Shaders in Flutter?
How to Create Custom Shaders in Flutter?
 
COLLADA & WebGL
COLLADA & WebGLCOLLADA & WebGL
COLLADA & WebGL
 
Lagoa
LagoaLagoa
Lagoa
 
Cocoa Heads Tricity - Design Patterns
Cocoa Heads Tricity - Design PatternsCocoa Heads Tricity - Design Patterns
Cocoa Heads Tricity - Design Patterns
 

03 add markers

  • 1. Add markers using openscales 1.2 Tutorial 3 Marine Jourdain
  • 2. Prerequisites This tutorial begins where ”Create Your First Map Using OpenScales” (tutorial 2) left off. 2
  • 3. What you obtain with this tutorial 3
  • 4. Action Script code to obtain the map 4 <fx:Script> <![CDATA[ importorg.openscales.basetypes.Location; importorg.openscales.core.Map; importorg.openscales.core.feature.CustomMarker; importorg.openscales.core.feature.PointFeature; importorg.openscales.core.layer.FeatureLayer; importorg.openscales.core.style.Style; importorg.openscales.geometry.Point; import org.openscales.proj4as.ProjProjection; [Bindable] privatevar map:Map = null; privatefunctioninitMap():void { map = fxmap.map; varmarkers:FeatureLayer = newFeatureLayer("NameOfYourLayerWithMarkers"); markers.projection = newProjProjection("EPSG:4326"); markers.generateResolutions(19); markers.style = Style.getDefaultPointStyle(); //add the first marker varmarker:PointFeature = PointFeature.createPointFeature(newLocation(4.85680,45.75336)); markers.addFeature(marker); //add a second marker marker = PointFeature.createPointFeature(newLocation(4.85780,45.75336)); markers.addFeature(marker); //add marker with different symbol, writing url address markers.addFeature(CustomMarker. createUrlBasedMarker("http://earth.google.com/intl/en_uk/outreach/images/add_placemark.png", newLocation(4.85580,45.75336))); //add the layer map.addLayer(markers); } ]]> </fx:Script>
  • 5. Add a default style marker (1) A marker is created in the Action Script part of the mxml file. To create a simple marker you need: to create a feature layer to define the system of projection used by the layer to generate the resolutions at which the markers will be visible to define the default style to create a point with the correct coordinates (same projection as the layer) 5
  • 6. Add a default style marker (2) The Action Script code becomes: <fx:Script> <![CDATA[ importorg.openscales.core.Map; importorg.openscales.core.feature.PointFeature; importorg.openscales.core.layer.FeatureLayer; importorg.openscales.core.style.Style; importorg.openscales.geometry.Point; import org.openscales.proj4as.ProjProjection; [Bindable] privatevar map:Map = null; privatefunctioninitMap():void { map = fxmap.map; varmarkers:FeatureLayer = newFeatureLayer("NameOfYourLayerWithMarkers"); markers.projection = newProjProjection("EPSG:4326"); markers.generateResolutions(19); markers.style = Style.getDefaultPointStyle(); varmarker:PointFeature=PointFeature.createPointFeature(new Location(4.85980,45.75336)); markers.addFeature(marker); map.addLayer(markers); } ]]> </fx:Script> 6
  • 7. Add another marker Write these two lines before adding the layer ( ) map.addLayer(markers); marker = PointFeature.createPointFeature(new Location(4.85980,45.75336)); markers.addFeature(marker); 7
  • 8. Add marker with custom symbol Symbol from URL address: Add this import next to the others: Add the marker using the static CustomMarker.createUrlBasedMarker(url, point) before adding the layer ( ): importorg.openscales.core.feature.CustomMarker; markers.addFeature(CustomMarker. createUrlBasedMarker("http://earth.google.com/intl/en_uk/outreach/images/add_placemark.png", new Location(4.85980,45.75336))); 8 map.addLayer(markers);
  • 9. Here you are Right now, you’re able to add markers to your OpenScales maps. Find sources: http://www.openscales.org/tutorials/ 9