Custom location marker
-
Hi,
I’d like to change the marker for the current location (or the location marker of the search widget). Currently it is a blue dot and I would like to use a custom marker.
I’m using the Google Mashup Custom widget, Google v3 and I’ve already changed the markers for my added location by using this script (custom.js):
(function() { GeoMashup.addAction( 'colorIcon', function( properties, icon, color_name ) { // For single category icons use the Geo Mashup color icon names, // but the 24x24 ones in the custom image directory icon.image = properties.custom_url_path + '/images/grass.png'; icon.iconShadow = ''; icon.iconSize = [ 32, 37 ]; icon.iconAnchor = [ 12, 24 ]; icon.iconInfoWindowAnchor = [ 12, 1 ]; } ); GeoMashup.addAction( 'objectIcon', function( properties, obj ) { if ( obj.categories.length == 0 ) { // When there are no categories - mm_20_uncategorised.png obj.icon.image = properties.custom_url_path + '/images/grass.png'; obj.icon.iconShadow = ''; obj.icon.iconSize = [ 24, 24 ]; obj.icon.iconAnchor = [ 12, 24 ]; obj.icon.iconInfoWindowAnchor = [ 12, 1 ]; } else if ( obj.categories.length > 1 ) { // When there is more than one category - mm_20_mixed.png obj.icon.image = properties.custom_url_path + '/images/grass.png'; obj.icon.iconShadow = ''; obj.icon.iconSize = [ 24, 24 ]; obj.icon.iconAnchor = [ 12, 24 ]; obj.icon.iconInfoWindowAnchor = [ 12, 1 ]; } } ); GeoMashup.addAction( 'multiObjectMarker', function( properties, marker ) { // When there is more than one marker assigned to the same location - mm_20_plus.png marker.setIcon( properties.custom_url_path + '/images/mm_20_plus.png' ); } ); GeoMashup.addAction( 'singleMarkerOptions', function ( properties, options ) { // When the map is a single object map with just one marker options.icon.image = properties.custom_url_path + '/images/grass.png'; options.icon.iconShadow = ''; options.icon.iconSize = [ 24, 24 ]; options.icon.iconAnchor = [ 12, 24 ]; options.icon.iconInfoWindowAnchor = [ 12, 1 ]; } ); GeoMashup.addAction( ' }());
Is it possible to add code in my custom.js to add the marker for the current location?
Thank you!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom location marker’ is closed to new replies.